Class: Querly::Pattern::Argument::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/querly/pattern/argument.rb

Direct Known Subclasses

AnySeq, BlockPass, Expr, KeyValue

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(tail:) ⇒ Base

Returns a new instance of Base.



7
8
9
# File 'lib/querly/pattern/argument.rb', line 7

def initialize(tail:)
  @tail = tail
end

Instance Attribute Details

#tailObject (readonly)

Returns the value of attribute tail.



5
6
7
# File 'lib/querly/pattern/argument.rb', line 5

def tail
  @tail
end

Instance Method Details

#==(other) ⇒ Object



11
12
13
# File 'lib/querly/pattern/argument.rb', line 11

def ==(other)
  other.class == self.class && other.attributes == attributes
end

#attributesObject



15
16
17
18
19
# File 'lib/querly/pattern/argument.rb', line 15

def attributes
  instance_variables.each.with_object({}) do |name, hash|
    hash[name] = instance_variable_get(name)
  end
end