Class: Ray::Key
- Inherits:
-
Object
- Object
- Ray::Key
- Defined in:
- lib/ray/dsl/matcher.rb
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(name) ⇒ Key
constructor
A new instance of Key.
- #inspect ⇒ Object
- #to_a ⇒ Object
- #to_sym ⇒ Object
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 |
#inspect ⇒ Object
197 198 199 |
# File 'lib/ray/dsl/matcher.rb', line 197 def inspect "key(#{to_sym})" end |
#to_a ⇒ Object
185 186 187 |
# File 'lib/ray/dsl/matcher.rb', line 185 def to_a Keys[@symbol] end |
#to_sym ⇒ Object
189 190 191 |
# File 'lib/ray/dsl/matcher.rb', line 189 def to_sym @symbol end |