class WWWJDic::Parsers::Display
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.
M = backdoor entry (regular display) or Z = backdoor entry (raw dictionary display)
- Author
- Copyright
-
Copyright © 2014, 2015, 2016, 2017, 2018, 2019 Marco Bresciani
- License
-
GNU General Public License version 3
Public Instance Methods
parse(value = :display)
click to toggle source
The parsable duck type interface to every parser usage.
# File lib/wwwjdic/parsers/display.rb 40 def parse(value = :display) 41 raise ArgumentError, I18n.t('error.nil') if value.nil? 42 raise ArgumentError, I18n.t('error.param', value: value) unless value.is_a? Symbol 43 44 raiser_array('error.param', value, DISPLAY.keys) 45 46 value 47 end