Class: Mxrb::Model::Menu
Instance Attribute Summary collapse
-
#items ⇒ Object
readonly
Returns the value of attribute items.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#raw_document ⇒ Object
readonly
Returns the value of attribute raw_document.
Attributes inherited from Unit
#bson_type, #container_id, #containment_name, #id, #mpr
Instance Method Summary collapse
Methods inherited from Unit
Constructor Details
This class inherits a constructor from Mxrb::Model::Unit
Instance Attribute Details
#items ⇒ Object (readonly)
Returns the value of attribute items.
8 9 10 |
# File 'lib/mxrb/model/menu.rb', line 8 def items @items end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/mxrb/model/menu.rb', line 8 def name @name end |
#raw_document ⇒ Object (readonly)
Returns the value of attribute raw_document.
8 9 10 |
# File 'lib/mxrb/model/menu.rb', line 8 def raw_document @raw_document end |
Instance Method Details
#decode(doc) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/mxrb/model/menu.rb', line 10 def decode(doc) @raw_document = doc @name = doc["Name"] collection = doc["ItemCollection"] || {} @items = parse_array(collection["Items"]).map { (_1) } end |