class Gravaty::Parsers::Rating

This class is an implementation of the Parsable duck type that checks the rating type. The only needed parameter is a valid rating type.

Author

Marco Bresciani

Copyright

Copyright © 2013, 2014, 2015, 2016, 2017, 2018,

2019 Marco Bresciani

License

GNU General Public License version 3

Public Instance Methods

parse(value = nil) click to toggle source

the parsable duck type interface to every parser usage.

   # File lib/gravaty/parsers/rating.rb
39 def parse(value = nil)
40   raiser_downcase('error.value', value, RATING_OPTIONS)
41   value.nil? ? '' : "rating=#{value.downcase.to_s}"
42 end