Class: Odin::Transform::VerbExpr

Inherits:
FieldExpression show all
Defined in:
lib/odin/transform/transform_types.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(verb_name, arguments = [], custom: false) ⇒ VerbExpr

Returns a new instance of VerbExpr.



207
208
209
210
211
# File 'lib/odin/transform/transform_types.rb', line 207

def initialize(verb_name, arguments = [], custom: false)
  @verb_name = verb_name
  @arguments = arguments
  @custom = custom
end

Instance Attribute Details

#argumentsObject (readonly)

arguments: Array<FieldExpression>



204
205
206
# File 'lib/odin/transform/transform_types.rb', line 204

def arguments
  @arguments
end

#customObject (readonly)

boolean — true for %&customVerb



205
206
207
# File 'lib/odin/transform/transform_types.rb', line 205

def custom
  @custom
end

#verb_nameObject (readonly)

arguments: Array<FieldExpression>



204
205
206
# File 'lib/odin/transform/transform_types.rb', line 204

def verb_name
  @verb_name
end

Instance Method Details

#==(other) ⇒ Object



213
214
215
216
# File 'lib/odin/transform/transform_types.rb', line 213

def ==(other)
  other.is_a?(VerbExpr) && verb_name == other.verb_name &&
    arguments == other.arguments && custom == other.custom
end