Class: Diggr::Topic

Inherits:
Object
  • Object
show all
Defined in:
lib/diggr/response_classes/topic.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#containerObject

Returns the value of attribute container.



7
8
9
# File 'lib/diggr/response_classes/topic.rb', line 7

def container
  @container
end

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/diggr/response_classes/topic.rb', line 7

def name
  @name
end

#short_nameObject

Returns the value of attribute short_name.



7
8
9
# File 'lib/diggr/response_classes/topic.rb', line 7

def short_name
  @short_name
end

Class Method Details

.new_from_parsed_json(data) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/diggr/response_classes/topic.rb', line 9

def self.new_from_parsed_json(data)
  topic = Topic.new
  topic.name = data['name']
  topic.short_name = data['short_name']

  if data.has_key? 'container'
    topic.container = Diggr::Container.new_from_parsed_json(data['container']) 
  end

  topic
end