Class: Koi::Helpers::AttributeHelpers::IntrospectedAttribute
- Inherits:
-
Rails::Generators::GeneratedAttribute
- Object
- Rails::Generators::GeneratedAttribute
- Koi::Helpers::AttributeHelpers::IntrospectedAttribute
- Defined in:
- lib/generators/koi/helpers/attribute_helpers.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
readonly
Returns the value of attribute association.
-
#attachment ⇒ Object
readonly
Returns the value of attribute attachment.
-
#enum ⇒ Object
readonly
Returns the value of attribute enum.
Instance Method Summary collapse
- #association? ⇒ Boolean
- #attachment? ⇒ Boolean
- #enum? ⇒ Boolean
-
#initialize(name, type, association: nil, attachment: nil, enum: nil) ⇒ IntrospectedAttribute
constructor
A new instance of IntrospectedAttribute.
Constructor Details
#initialize(name, type, association: nil, attachment: nil, enum: nil) ⇒ IntrospectedAttribute
Returns a new instance of IntrospectedAttribute.
27 28 29 30 31 32 33 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 27 def initialize(name, type, association: nil, attachment: nil, enum: nil, **) super(name, type, **) @association = association @attachment = @enum = enum end |
Instance Attribute Details
#association ⇒ Object (readonly)
Returns the value of attribute association.
25 26 27 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 25 def association @association end |
#attachment ⇒ Object (readonly)
Returns the value of attribute attachment.
25 26 27 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 25 def @attachment end |
#enum ⇒ Object (readonly)
Returns the value of attribute enum.
25 26 27 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 25 def enum @enum end |
Instance Method Details
#association? ⇒ Boolean
35 36 37 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 35 def association? @association.present? end |
#attachment? ⇒ Boolean
39 40 41 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 39 def @attachment.present? end |
#enum? ⇒ Boolean
43 44 45 |
# File 'lib/generators/koi/helpers/attribute_helpers.rb', line 43 def enum? @enum.present? end |