Class: Steep::AST::Types::Logic::Env
- Defined in:
- lib/steep/ast/types/logic.rb
Instance Attribute Summary collapse
-
#falsy ⇒ Object
readonly
Returns the value of attribute falsy.
-
#truthy ⇒ Object
readonly
Returns the value of attribute truthy.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(truthy:, falsy:, type:) ⇒ Env
constructor
A new instance of Env.
- #inspect ⇒ Object (also: #to_s)
Methods inherited from Base
Methods included from SharedInstance
Methods included from Helper::NoChild
Methods included from Helper::NoFreeVariables
Constructor Details
#initialize(truthy:, falsy:, type:) ⇒ Env
Returns a new instance of Env.
59 60 61 62 63 |
# File 'lib/steep/ast/types/logic.rb', line 59 def initialize(truthy:, falsy:, type:) @truthy = truthy @falsy = falsy @type = type end |
Instance Attribute Details
#falsy ⇒ Object (readonly)
Returns the value of attribute falsy.
57 58 59 |
# File 'lib/steep/ast/types/logic.rb', line 57 def falsy @falsy end |
#truthy ⇒ Object (readonly)
Returns the value of attribute truthy.
57 58 59 |
# File 'lib/steep/ast/types/logic.rb', line 57 def truthy @truthy end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
57 58 59 |
# File 'lib/steep/ast/types/logic.rb', line 57 def type @type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
65 66 67 |
# File 'lib/steep/ast/types/logic.rb', line 65 def ==(other) other.is_a?(Env) && other.truthy == truthy && other.falsy == falsy && other.type == type end |
#hash ⇒ Object
71 72 73 |
# File 'lib/steep/ast/types/logic.rb', line 71 def hash self.class.hash ^ truthy.hash ^ falsy.hash end |
#inspect ⇒ Object Also known as: to_s
75 76 77 |
# File 'lib/steep/ast/types/logic.rb', line 75 def inspect "#<Steep::AST::Types::Env @type=#{type}, @truthy=..., @falsy=...>" end |