class DrgDSL::Ast::UnaryCondition
Has a certain operator (i.e. not / different) and a condition
“not < 3”
Attributes
condition[R]
op[R]
Public Class Methods
new(op:, condition:)
click to toggle source
@param op [String]
# File lib/drgdsl/ast.rb, line 276 def initialize(op:, condition:) @op = op.to_s.downcase @condition = condition end
Public Instance Methods
hash()
click to toggle source
# File lib/drgdsl/ast.rb, line 290 def hash @hash ||= [type, op, condition].hash end
to_hash()
click to toggle source
# File lib/drgdsl/ast.rb, line 281 def to_hash { unary_condition: { op: op, condition: condition.to_hash } } end