Class: Hamachi::Model::EnumMatcher

Inherits:
Matcher
  • Object
show all
Defined in:
lib/hamachi/model.rb

Instance Method Summary collapse

Methods inherited from Matcher

#default_value, #initialize, #initialize_options

Constructor Details

This class inherits a constructor from Hamachi::Model::Matcher

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_sObject



217
218
219
# File 'lib/hamachi/model.rb', line 217

def to_s
  "enum(#{@type.map(&:inspect).join(', ')})"
end