Class: Ray::Key

Inherits:
Object
  • Object
show all
Defined in:
lib/ray/dsl/matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Key

Returns a new instance of Key.



181
182
183
# File 'lib/ray/dsl/matcher.rb', line 181

def initialize(name)
  @symbol = name.to_sym
end

Instance Method Details

#===(other) ⇒ Object



193
194
195
# File 'lib/ray/dsl/matcher.rb', line 193

def ===(other)
  to_a.include? other
end

#inspectObject



197
198
199
# File 'lib/ray/dsl/matcher.rb', line 197

def inspect
  "key(#{to_sym})"
end

#to_aObject



185
186
187
# File 'lib/ray/dsl/matcher.rb', line 185

def to_a
  Keys[@symbol]
end

#to_symObject



189
190
191
# File 'lib/ray/dsl/matcher.rb', line 189

def to_sym
  @symbol
end