Class: SyntaxTree::LanguageServer::Request::Shape
- Inherits:
-
Object
- Object
- SyntaxTree::LanguageServer::Request::Shape
- Defined in:
- lib/syntax_tree/language_server.rb
Overview
Represents a hash pattern.
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #===(other) ⇒ Object
-
#initialize(values) ⇒ Shape
constructor
A new instance of Shape.
Constructor Details
#initialize(values) ⇒ Shape
Returns a new instance of Shape.
179 180 181 |
# File 'lib/syntax_tree/language_server.rb', line 179 def initialize(values) @values = values end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
177 178 179 |
# File 'lib/syntax_tree/language_server.rb', line 177 def values @values end |
Instance Method Details
#===(other) ⇒ Object
183 184 185 186 187 |
# File 'lib/syntax_tree/language_server.rb', line 183 def ===(other) values.all? do |key, value| value == :any ? other.key?(key) : value === other[key] end end |