Class: AssociationReflection
- Inherits:
-
Object
- Object
- AssociationReflection
- Defined in:
- lib/spira/association_reflection.rb
Instance Attribute Summary collapse
-
#macro ⇒ Object
readonly
Returns the value of attribute macro.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #class_name ⇒ Object
-
#initialize(macro, name, options = {}) ⇒ AssociationReflection
constructor
A new instance of AssociationReflection.
- #klass ⇒ Object
Constructor Details
#initialize(macro, name, options = {}) ⇒ AssociationReflection
Returns a new instance of AssociationReflection.
6 7 8 9 10 |
# File 'lib/spira/association_reflection.rb', line 6 def initialize(macro, name, = {}) @macro = macro @name = name @options = end |
Instance Attribute Details
#macro ⇒ Object (readonly)
Returns the value of attribute macro.
2 3 4 |
# File 'lib/spira/association_reflection.rb', line 2 def macro @macro end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/spira/association_reflection.rb', line 3 def name @name end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/spira/association_reflection.rb', line 4 def @options end |
Instance Method Details
#class_name ⇒ Object
12 13 14 |
# File 'lib/spira/association_reflection.rb', line 12 def class_name @class_name ||= ([:type] || derive_class_name).to_s end |
#klass ⇒ Object
16 17 18 |
# File 'lib/spira/association_reflection.rb', line 16 def klass @klass ||= class_name.constantize end |