Class: Camille::Types::Tuple
- Defined in:
- lib/camille/types/tuple.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
Attributes inherited from BasicType
Instance Method Summary collapse
- #check(value) ⇒ Object
- #check_params(value) ⇒ Object
-
#initialize(elements) ⇒ Tuple
constructor
A new instance of Tuple.
- #literal ⇒ Object
Methods inherited from BasicType
&, #&, #[], [], check_params, directly_instantiable?, inherited, instance, |, #|
Constructor Details
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
4 5 6 |
# File 'lib/camille/types/tuple.rb', line 4 def elements @elements end |
Instance Method Details
#check(value) ⇒ Object
11 12 13 |
# File 'lib/camille/types/tuple.rb', line 11 def check value check_with_method(value, :check) end |
#check_params(value) ⇒ Object
15 16 17 |
# File 'lib/camille/types/tuple.rb', line 15 def check_params value check_with_method(value, :check_params) end |
#literal ⇒ Object
19 20 21 |
# File 'lib/camille/types/tuple.rb', line 19 def literal "[#{elements.map(&:literal).join(', ')}]" end |