Class: Lab42::DataClass::Constraints::AttributeSetters::ListOfAttributeSetter
- Inherits:
-
Object
- Object
- Lab42::DataClass::Constraints::AttributeSetters::ListOfAttributeSetter
show all
- Includes:
- AttributeSetter
- Defined in:
- lib/lab42/data_class/constraints/attribute_setters/list_of_attribute_setter.rb
Instance Attribute Summary
#attribute, #constraint, #instance, #return_setter
Instance Method Summary
collapse
Instance Method Details
#cdr ⇒ Object
18
19
20
|
# File 'lib/lab42/data_class/constraints/attribute_setters/list_of_attribute_setter.rb', line 18
def cdr
_set_attr!(_value.cdr)
end
|
#cons(value) ⇒ Object
11
12
13
14
15
16
|
# File 'lib/lab42/data_class/constraints/attribute_setters/list_of_attribute_setter.rb', line 11
def cons(value)
constraint.constraint.(value) or raise ConstraintError,
"cannot set value #{value} in set(#{attribute}).cons"
_set_attr!(_value.cons(value))
end
|
#set_car(value) ⇒ Object
22
23
24
25
26
|
# File 'lib/lab42/data_class/constraints/attribute_setters/list_of_attribute_setter.rb', line 22
def set_car(value)
constraint.constraint.(value) or raise ConstraintError,
"cannot set value #{value} in set(#{attribute}).cons"
_set_attr!(_value.cdr.cons(value))
end
|