lib/wwwjdic/parsers/key.rb in wwwjdic-14.0.0 vs lib/wwwjdic/parsers/key.rb in wwwjdic-15.0.0
- old
+ new
@@ -1,8 +1,8 @@
#--
# wwwjdic
-# Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
+# © 2014 Marco Bresciani
#
# This file is part of wwwjdic.
#
# wwwjdic is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -14,16 +14,21 @@
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with wwwjdic. If not, see <http://www.gnu.org/licenses/>.
+#
+# SPDX-FileCopyrightText: 2014 Marco Bresciani
+#
+# SPDX-License-Identifier: GPL-3.0-or-later
#++
require_relative '../constants'
module WWWJDic
module Parsers
+
# This class is an implementation of the Parsable duck type that
# checks the display type. The only needed parameter is the word to
# translate.
#
# k is the key type:
@@ -54,16 +59,16 @@
# for EUC, ISO-2022-JP or UCS, S for Shift_JIS and U for UTF-8,
# followed by the search string. Up to 99 example sentences may be
# displayed.
#
# Author:: {Marco Bresciani}[mailto:marcobresciani_1974@libero.it]
- # Copyright:: Copyright © 2014, 2015, 2016, 2017, 2018, 2019, 2020 Marco Bresciani
+ # Copyright:: (C) 2014 Marco Bresciani
# License:: GNU General Public License version 3
class Key
include Utils::Raisers
# The parsable duck type interface to every parser usage.
- def parse(value = :exact)
+ def parse(value = :english)
raise ArgumentError, I18n.t('error.nil') if value.nil?
raise ArgumentError, I18n.t('error.param', value: value) unless value.is_a? Symbol
raiser_array('error.param', value, KEYS.keys)