Class: Category
Overview
category.from_array(array) # => Array of Category objects
Instance Attribute Summary collapse
-
#annotations ⇒ Object
Returns the value of attribute annotations.
-
#category ⇒ Object
Returns the value of attribute category.
-
#code ⇒ Object
Returns the value of attribute code.
-
#group ⇒ Object
Returns the value of attribute group.
-
#hidden ⇒ Object
Returns the value of attribute hidden.
Class Method Summary collapse
-
.from_array(array) ⇒ Object
Method
from_array
returns array of categories(create from json).
Methods inherited from Struct
Instance Attribute Details
#annotations ⇒ Object
Returns the value of attribute annotations
12 13 14 |
# File 'lib/models/category.rb', line 12 def annotations @annotations end |
#category ⇒ Object
Returns the value of attribute category
12 13 14 |
# File 'lib/models/category.rb', line 12 def category @category end |
#code ⇒ Object
Returns the value of attribute code
12 13 14 |
# File 'lib/models/category.rb', line 12 def code @code end |
#group ⇒ Object
Returns the value of attribute group
12 13 14 |
# File 'lib/models/category.rb', line 12 def group @group end |
#hidden ⇒ Object
Returns the value of attribute hidden
12 13 14 |
# File 'lib/models/category.rb', line 12 def hidden @hidden end |
Class Method Details
.from_array(array) ⇒ Object
Method from_array
returns array of categories(create from json). Takes value of array objects as json parameter array.
Example:
Category.from_array([...array of JSON objects...]) # => Array of Category
21 22 23 24 25 |
# File 'lib/models/category.rb', line 21 def self.from_array(array) array.collect do |element| Category.new(element) end end |