Module: Radio5::Validations::Matchers
- Included in:
- Radio5::Validations
- Defined in:
- lib/radio5/validations/matchers.rb
Class Method Summary collapse
- .country_iso_code?(object) ⇒ Boolean
- .decade?(object) ⇒ Boolean
- .mongo_id?(object) ⇒ Boolean
- .mood?(object) ⇒ Boolean
- .positive_number?(object) ⇒ Boolean
- .user_track_status?(object) ⇒ Boolean
Class Method Details
.country_iso_code?(object) ⇒ Boolean
12 13 14 |
# File 'lib/radio5/validations/matchers.rb', line 12 def country_iso_code?(object) object.is_a?(String) && object.match?(Regexps::COUNTRY_ISO_CODE) end |
.decade?(object) ⇒ Boolean
16 17 18 |
# File 'lib/radio5/validations/matchers.rb', line 16 def decade?(object) object.is_a?(Integer) && Constants::DECADES.include?(object) end |
.mongo_id?(object) ⇒ Boolean
8 9 10 |
# File 'lib/radio5/validations/matchers.rb', line 8 def mongo_id?(object) object.is_a?(String) && object.match?(Regexps::MONGO_ID) end |
.mood?(object) ⇒ Boolean
20 21 22 |
# File 'lib/radio5/validations/matchers.rb', line 20 def mood?(object) object.is_a?(Symbol) && Constants::MOODS.include?(object) end |
.positive_number?(object) ⇒ Boolean
28 29 30 |
# File 'lib/radio5/validations/matchers.rb', line 28 def positive_number?(object) object.is_a?(Integer) && object.positive? end |
.user_track_status?(object) ⇒ Boolean
24 25 26 |
# File 'lib/radio5/validations/matchers.rb', line 24 def user_track_status?(object) object.is_a?(Symbol) && Constants::USER_TRACK_STATUSES.include?(object) end |