Class: Opium::Pointer
Instance Attribute Summary collapse
-
#class_name ⇒ Object
(also: #model_name)
readonly
Returns the value of attribute class_name.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ Pointer
constructor
A new instance of Pointer.
- #to_parse ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ Pointer
Returns a new instance of Pointer.
3 4 5 6 |
# File 'lib/opium/extensions/pointer.rb', line 3 def initialize( attributes = {} ) self.class_name = attributes[:class_name] || attributes[:model_name] || (attributes[:class] || attributes[:model]).model_name self.id = attributes[:id] end |
Instance Attribute Details
#class_name ⇒ Object Also known as: model_name
Returns the value of attribute class_name.
8 9 10 |
# File 'lib/opium/extensions/pointer.rb', line 8 def class_name @class_name end |
#id ⇒ Object
Returns the value of attribute id.
8 9 10 |
# File 'lib/opium/extensions/pointer.rb', line 8 def id @id end |
Instance Method Details
#to_parse ⇒ Object
11 12 13 |
# File 'lib/opium/extensions/pointer.rb', line 11 def to_parse { __type: 'Pointer', className: class_name, objectId: id }.with_indifferent_access end |