class WWWJDic::Parsers::Server

This class is an implementation of the Parsable duck type that checks the display type. The only needed parameter is a boolean, with true for regular.

Author

Marco Bresciani

Copyright

© 2014-2021 Marco Bresciani

License

GNU General Public License version 3

Public Instance Methods

parse(value = :edrdg) click to toggle source

The parsable duck type interface to every parser usage.

   # File lib/wwwjdic/parsers/server.rb
42 def parse(value = :edrdg)
43   raise ArgumentError, I18n.t('error.nil') if value.nil?
44   raise ArgumentError, I18n.t('error.param', value: value) unless value.is_a? Symbol
45
46   raiser_array('error.param', value, URIS.keys)
47
48   value
49 end