Class: Moblues::DataModel::Entity
- Inherits:
-
Struct
- Object
- Struct
- Moblues::DataModel::Entity
- Defined in:
- lib/moblues/data_model/entity.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
Returns the value of attribute attributes.
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent_entity ⇒ Object
Returns the value of attribute parent_entity.
-
#relationships ⇒ Object
Returns the value of attribute relationships.
Instance Method Summary collapse
-
#initialize(params) ⇒ Entity
constructor
A new instance of Entity.
Constructor Details
#initialize(params) ⇒ Entity
6 7 8 9 10 11 12 13 14 |
# File 'lib/moblues/data_model/entity.rb', line 6 def initialize(params) p = params.compact super( p.fetch(:name), p.fetch(:parent_entity, 'NSManagedObject'), p.fetch(:attributes, []), p.fetch(:relationships, []) ) end |
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes
5 6 7 |
# File 'lib/moblues/data_model/entity.rb', line 5 def attributes @attributes end |
#name ⇒ Object
Returns the value of attribute name
5 6 7 |
# File 'lib/moblues/data_model/entity.rb', line 5 def name @name end |
#parent_entity ⇒ Object
Returns the value of attribute parent_entity
5 6 7 |
# File 'lib/moblues/data_model/entity.rb', line 5 def parent_entity @parent_entity end |
#relationships ⇒ Object
Returns the value of attribute relationships
5 6 7 |
# File 'lib/moblues/data_model/entity.rb', line 5 def relationships @relationships end |