Class: DataWorks::NecessaryParent
- Inherits:
-
Object
- Object
- DataWorks::NecessaryParent
- Defined in:
- lib/data_works/necessary_parent.rb
Instance Attribute Summary collapse
-
#association_name ⇒ Object
readonly
Returns the value of attribute association_name.
-
#model_name ⇒ Object
readonly
Returns the value of attribute model_name.
Instance Method Summary collapse
-
#initialize(entry) ⇒ NecessaryParent
constructor
A new instance of NecessaryParent.
Constructor Details
#initialize(entry) ⇒ NecessaryParent
Returns a new instance of NecessaryParent.
17 18 19 20 21 22 23 24 |
# File 'lib/data_works/necessary_parent.rb', line 17 def initialize(entry) if entry.is_a? Hash @association_name = entry.keys.first @model_name = entry.values.first else @association_name = @model_name = entry end end |
Instance Attribute Details
#association_name ⇒ Object (readonly)
Returns the value of attribute association_name.
15 16 17 |
# File 'lib/data_works/necessary_parent.rb', line 15 def association_name @association_name end |
#model_name ⇒ Object (readonly)
Returns the value of attribute model_name.
15 16 17 |
# File 'lib/data_works/necessary_parent.rb', line 15 def model_name @model_name end |