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.
1716 1717 1718 |
# File 'lib/mxrb/dsl/builder.rb', line 1716 def initialize @members = [] end |
Instance Attribute Details
#members ⇒ Object (readonly)
Returns the value of attribute members.
1714 1715 1716 |
# File 'lib/mxrb/dsl/builder.rb', line 1714 def members @members end |
Instance Method Details
#set(attribute, to:) ⇒ Object
1720 1721 1722 |
# File 'lib/mxrb/dsl/builder.rb', line 1720 def set(attribute, to:) @members << { attribute: attribute.to_s, value: to } end |
#set_association(association, to:, operation: :set) ⇒ Object
1724 1725 1726 1727 1728 1729 |
# File 'lib/mxrb/dsl/builder.rb', line 1724 def set_association(association, to:, operation: :set) @members << { association: association.to_s, value: to, operation: operation.to_s } end |