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.
1750 1751 1752 |
# File 'lib/mxrb/dsl/builder.rb', line 1750 def initialize @members = [] end |
Instance Attribute Details
#members ⇒ Object (readonly)
Returns the value of attribute members.
1748 1749 1750 |
# File 'lib/mxrb/dsl/builder.rb', line 1748 def members @members end |
Instance Method Details
#set(attribute, to:) ⇒ Object
1754 1755 1756 |
# File 'lib/mxrb/dsl/builder.rb', line 1754 def set(attribute, to:) @members << { attribute: attribute.to_s, value: to } end |
#set_association(association, to:, operation: :set) ⇒ Object
1758 1759 1760 1761 1762 1763 |
# File 'lib/mxrb/dsl/builder.rb', line 1758 def set_association(association, to:, operation: :set) @members << { association: association.to_s, value: to, operation: operation.to_s } end |