Class: Mxrb::Dsl::SetBuilder
- Inherits:
-
Object
- Object
- Mxrb::Dsl::SetBuilder
- Defined in:
- lib/mxrb/dsl/builder.rb
Instance Attribute Summary collapse
-
#members ⇒ Object
readonly
Returns the value of attribute members.
Instance Method Summary collapse
-
#initialize ⇒ SetBuilder
constructor
A new instance of SetBuilder.
- #set(attribute, to:) ⇒ Object
- #set_association(association, to:, operation: :set) ⇒ Object
Constructor Details
#initialize ⇒ SetBuilder
Returns a new instance of SetBuilder.
1618 1619 1620 |
# File 'lib/mxrb/dsl/builder.rb', line 1618 def initialize @members = [] end |
Instance Attribute Details
#members ⇒ Object (readonly)
Returns the value of attribute members.
1616 1617 1618 |
# File 'lib/mxrb/dsl/builder.rb', line 1616 def members @members end |
Instance Method Details
#set(attribute, to:) ⇒ Object
1622 1623 1624 |
# File 'lib/mxrb/dsl/builder.rb', line 1622 def set(attribute, to:) @members << { attribute: attribute.to_s, value: to } end |
#set_association(association, to:, operation: :set) ⇒ Object
1626 1627 1628 1629 1630 1631 |
# File 'lib/mxrb/dsl/builder.rb', line 1626 def set_association(association, to:, operation: :set) @members << { association: association.to_s, value: to, operation: operation.to_s } end |