Class: Infold::ShowElement
- Inherits:
-
Object
- Object
- Infold::ShowElement
- Includes:
- ActiveModel::Model
- Defined in:
- lib/infold/property/show_element.rb
Instance Attribute Summary collapse
-
#association ⇒ Object
Returns the value of attribute association.
-
#association_fields ⇒ Object
readonly
Returns the value of attribute association_fields.
-
#field ⇒ Object
readonly
Returns the value of attribute field.
-
#seq ⇒ Object
Returns the value of attribute seq.
Instance Method Summary collapse
- #add_association_fields(field, **attrs) ⇒ Object
-
#initialize(field, **attrs) ⇒ ShowElement
constructor
A new instance of ShowElement.
- #kind_association? ⇒ Boolean
Constructor Details
#initialize(field, **attrs) ⇒ ShowElement
Returns a new instance of ShowElement.
11 12 13 14 15 |
# File 'lib/infold/property/show_element.rb', line 11 def initialize(field, **attrs) @field = field @association_fields = [] super(**attrs) end |
Instance Attribute Details
#association ⇒ Object
Returns the value of attribute association.
8 9 10 |
# File 'lib/infold/property/show_element.rb', line 8 def association @association end |
#association_fields ⇒ Object (readonly)
Returns the value of attribute association_fields.
5 6 7 |
# File 'lib/infold/property/show_element.rb', line 5 def association_fields @association_fields end |
#field ⇒ Object (readonly)
Returns the value of attribute field.
5 6 7 |
# File 'lib/infold/property/show_element.rb', line 5 def field @field end |
#seq ⇒ Object
Returns the value of attribute seq.
8 9 10 |
# File 'lib/infold/property/show_element.rb', line 8 def seq @seq end |
Instance Method Details
#add_association_fields(field, **attrs) ⇒ Object
17 18 19 20 |
# File 'lib/infold/property/show_element.rb', line 17 def add_association_fields(field, **attrs) field.build_show_element(**attrs) @association_fields << field end |
#kind_association? ⇒ Boolean
22 23 24 |
# File 'lib/infold/property/show_element.rb', line 22 def kind_association? field.association.present? end |