Class: Camille::Types::Intersection
- Defined in:
- lib/camille/types/intersection.rb
Defined Under Namespace
Classes: ArgumentError
Instance Attribute Summary collapse
-
#left ⇒ Object
readonly
Returns the value of attribute left.
-
#right ⇒ Object
readonly
Returns the value of attribute right.
Attributes inherited from BasicType
Instance Method Summary collapse
- #check(value) ⇒ Object
- #check_params(value) ⇒ Object
-
#initialize(left, right) ⇒ Intersection
constructor
A new instance of Intersection.
- #literal ⇒ Object
Methods inherited from BasicType
&, #&, #[], [], check_params, directly_instantiable?, inherited, instance, |, #|
Constructor Details
#initialize(left, right) ⇒ Intersection
Returns a new instance of Intersection.
8 9 10 11 12 |
# File 'lib/camille/types/intersection.rb', line 8 def initialize left, right @left = Camille::Type.instance left @right = Camille::Type.instance right @fingerprint = Digest::MD5.hexdigest "#{self.class.name}#{[@left.fingerprint, @right.fingerprint].sort}" end |
Instance Attribute Details
#left ⇒ Object (readonly)
Returns the value of attribute left.
6 7 8 |
# File 'lib/camille/types/intersection.rb', line 6 def left @left end |
#right ⇒ Object (readonly)
Returns the value of attribute right.
6 7 8 |
# File 'lib/camille/types/intersection.rb', line 6 def right @right end |
Instance Method Details
#check(value) ⇒ Object
14 15 16 |
# File 'lib/camille/types/intersection.rb', line 14 def check value check_with_method(value, :check) end |
#check_params(value) ⇒ Object
18 19 20 |
# File 'lib/camille/types/intersection.rb', line 18 def check_params value check_with_method(value, :check_params) end |
#literal ⇒ Object
22 23 24 |
# File 'lib/camille/types/intersection.rb', line 22 def literal "(#{@left.literal} & #{@right.literal})" end |