Class: Daylife::Topic

Inherits:
API
  • Object
show all
Defined in:
lib/daylife/topic.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Methods inherited from API

auth, get, #initialize, methodize

Constructor Details

This class inherits a constructor from Daylife::API

Instance Attribute Details

#daylife_urlObject

Returns the value of attribute daylife_url.



3
4
5
# File 'lib/daylife/topic.rb', line 3

def daylife_url
  @daylife_url
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/daylife/topic.rb', line 3

def name
  @name
end

#topic_idObject

Returns the value of attribute topic_id.



3
4
5
# File 'lib/daylife/topic.rb', line 3

def topic_id
  @topic_id
end

#typeObject

Returns the value of attribute type.



3
4
5
# File 'lib/daylife/topic.rb', line 3

def type
  @type
end

Class Method Details

.core_identifierObject



5
6
7
# File 'lib/daylife/topic.rb', line 5

def self.core_identifier
  return :name
end

.get_info(name, parameters = {}) ⇒ Object

This function returns basic information about a given topic specified by name. (A topic_id is not a valid input parameter for this call.)



11
12
13
# File 'lib/daylife/topic.rb', line 11

def self.get_info(name, parameters={})
  get :get_info, parameters.merge(:name => name)
end

This method is used to retrieve recent articles that contain the given topic specified by name or topic_id.



31
32
33
# File 'lib/daylife/topic.rb', line 31

def self.get_related_articles(name, parameters={})
  get :get_related_articles, parameters.merge(:name => name)
end

This method is used to retrieve images related to articles that contain the given topic_id.



16
17
18
# File 'lib/daylife/topic.rb', line 16

def self.get_related_images(topic_id, parameters={})
  get :get_related_images, parameters.merge(:name => name)
end

This method is used to retrieve quotes from articles that contain the given topic specified by name or topic_id.



26
27
28
# File 'lib/daylife/topic.rb', line 26

def self.get_related_quotes(name, parameters={})
  get :get_related_quotes, parameters.merge(:name => name)
end

This method retrieves topics that appear in the same articles as the given topic specified by name or topic_id.



21
22
23
# File 'lib/daylife/topic.rb', line 21

def self.get_related_topics(topic_id, parameters={})
  get :get_related_topics, parameters.merge(:name => name)
end