Class: TwicasStream::TwicasApiObject::Category

Inherits:
Object
  • Object
show all
Defined in:
lib/twicas_stream/twicas_api_object/category.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(elements = {}) ⇒ Category

:id => “_channel”, :name => “チャンネル”, :sub_categories => [ => “_system_channel_5”, :name => “ミュージックch”, :count => 100, => “_system_channel_6”, :name => “ママch”, :count => 49, => “_system_channel_7”, :name => “アニメch”, :count => 42 ] }



20
21
22
23
24
25
26
27
28
# File 'lib/twicas_stream/twicas_api_object/category.rb', line 20

def initialize elements = {}
	sub_categories = SubCategory.new(elements['sub_categories'])

	@object = {
				:id             => elements['id'],
				:name           => elements['name'],
				:sub_categories => sub_categories.objects
			}
end

Instance Attribute Details

#objectObject (readonly)

Returns the value of attribute object.



9
10
11
# File 'lib/twicas_stream/twicas_api_object/category.rb', line 9

def object
  @object
end