Class: Hamachi::Model::EnumMatcher
Instance Method Summary
collapse
Methods inherited from Matcher
#default_value, #initialize, #initialize_options
Instance Method Details
#===(value) ⇒ Object
213
214
215
|
# File 'lib/hamachi/model.rb', line 213
def ===(value)
@type.any? { |each| each === value }
end
|
#from_snapshot(data, options) ⇒ Object
221
222
223
|
# File 'lib/hamachi/model.rb', line 221
def from_snapshot(data, options)
String === data ? data.to_sym : data
end
|
#to_s ⇒ Object
217
218
219
|
# File 'lib/hamachi/model.rb', line 217
def to_s
"enum(#{@type.map(&:inspect).join(', ')})"
end
|