Class: ScraperWiki::API::Matchers::HaveIntegerValues

Inherits:
FieldMatcher show all
Defined in:
lib/scraperwiki-api/matchers.rb

Instance Method Summary collapse

Constructor Details

This class inherits a constructor from ScraperWiki::API::Matchers::CustomMatcher

Instance Method Details

#failure_predicateObject



736
737
738
# File 'lib/scraperwiki-api/matchers.rb', line 736

def failure_predicate
  "aren't integers"
end

#match?(v) ⇒ Boolean

Returns:

  • (Boolean)


732
733
734
# File 'lib/scraperwiki-api/matchers.rb', line 732

def match?(v)
  Integer(v) rescue false
end

#negative_failure_predicateObject



740
741
742
# File 'lib/scraperwiki-api/matchers.rb', line 740

def negative_failure_predicate
  'are integers'
end