Class: RakutenWebService::GenreInformation
- Inherits:
-
Object
- Object
- RakutenWebService::GenreInformation
- Defined in:
- lib/rakuten_web_service/genre_information.rb
Instance Attribute Summary collapse
-
#children ⇒ Object
readonly
Returns the value of attribute children.
-
#current ⇒ Object
readonly
Returns the value of attribute current.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
-
#initialize(params, genre_class) ⇒ GenreInformation
constructor
A new instance of GenreInformation.
Constructor Details
#initialize(params, genre_class) ⇒ GenreInformation
Returns a new instance of GenreInformation.
5 6 7 8 9 10 11 |
# File 'lib/rakuten_web_service/genre_information.rb', line 5 def initialize(params, genre_class) @parent = Array(params['parent']).first @parent = genre_class.new(@parent) if @parent @current = Array(params['current']).first @current = genre_class.new(@current) if @current @children = params['children'].map { |child| genre_class.new(child['child']) } end |
Instance Attribute Details
#children ⇒ Object (readonly)
Returns the value of attribute children.
3 4 5 |
# File 'lib/rakuten_web_service/genre_information.rb', line 3 def children @children end |
#current ⇒ Object (readonly)
Returns the value of attribute current.
3 4 5 |
# File 'lib/rakuten_web_service/genre_information.rb', line 3 def current @current end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
3 4 5 |
# File 'lib/rakuten_web_service/genre_information.rb', line 3 def parent @parent end |