Class: JsonProjection::Key

Inherits:
StreamEvent show all
Defined in:
lib/json-projection/parser/events.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from StreamEvent

empty

Constructor Details

#initialize(key) ⇒ Key

Returns a new instance of Key.



40
41
42
# File 'lib/json-projection/parser/events.rb', line 40

def initialize(key)
  @key = key
end

Instance Attribute Details

#keyObject (readonly)

Returns the value of attribute key.



39
40
41
# File 'lib/json-projection/parser/events.rb', line 39

def key
  @key
end

Instance Method Details

#==(other) ⇒ Object



44
45
46
47
# File 'lib/json-projection/parser/events.rb', line 44

def ==(other)
  return false unless super(other)
  return key == other.key
end

#hashObject



49
50
51
# File 'lib/json-projection/parser/events.rb', line 49

def hash
  key.hash
end