diff options
Diffstat (limited to 'lib/rss')
-rw-r--r-- | lib/rss/itunes.rb | 2 | ||||
-rw-r--r-- | lib/rss/maker/itunes.rb | 8 | ||||
-rw-r--r-- | lib/rss/rss.rb | 14 | ||||
-rw-r--r-- | lib/rss/utils.rb | 6 |
4 files changed, 15 insertions, 15 deletions
diff --git a/lib/rss/itunes.rb b/lib/rss/itunes.rb index 827970c209..987b090f21 100644 --- a/lib/rss/itunes.rb +++ b/lib/rss/itunes.rb @@ -51,7 +51,7 @@ module RSS ELEMENT_INFOS = [["author"], ["block", :yes_other], - ["explicit", :yes_clean_other], + ["explicit", :explicit_clean_other], ["keywords", :csv], ["subtitle"], ["summary"]] diff --git a/lib/rss/maker/itunes.rb b/lib/rss/maker/itunes.rb index cc1051ae0c..d964a4d942 100644 --- a/lib/rss/maker/itunes.rb +++ b/lib/rss/maker/itunes.rb @@ -13,8 +13,8 @@ module RSS klass.def_other_element(full_name) when :yes_other def_yes_other_accessor(klass, full_name) - when :yes_clean_other - def_yes_clean_other_accessor(klass, full_name) + when :explicit_clean_other + def_explicit_clean_other_accessor(klass, full_name) when :csv def_csv_accessor(klass, full_name) when :element, :attribute @@ -43,11 +43,11 @@ module RSS EOC end - def def_yes_clean_other_accessor(klass, full_name) + def def_explicit_clean_other_accessor(klass, full_name) klass.def_other_element(full_name) klass.module_eval(<<-EOC, __FILE__, __LINE__ + 1) def #{full_name}? - Utils::YesCleanOther.parse(#{full_name}) + Utils::ExplicitCleanOther.parse(#{full_name}) end EOC end diff --git a/lib/rss/rss.rb b/lib/rss/rss.rb index 00db219d4e..f88bb3c1ba 100644 --- a/lib/rss/rss.rb +++ b/lib/rss/rss.rb @@ -374,12 +374,12 @@ EOC end end - def yes_clean_other_attr_reader(*attrs) + def explicit_clean_other_attr_reader(*attrs) attrs.each do |attr| module_eval(<<-EOC, __FILE__, __LINE__ + 1) attr_reader(:#{attr}) def #{attr}? - YesCleanOther.parse(@#{attr}) + ExplicitCleanOther.parse(@#{attr}) end EOC end @@ -544,7 +544,7 @@ EOC EOC end - def yes_clean_other_writer(name, disp_name=name) + def explicit_clean_other_writer(name, disp_name=name) module_eval(<<-EOC, __FILE__, __LINE__ + 1) def #{name}=(value) value = (value ? "yes" : "no") if [true, false].include?(value) @@ -763,8 +763,8 @@ EOC text_type_writer name, disp_name when :content content_writer name, disp_name - when :yes_clean_other - yes_clean_other_writer name, disp_name + when :explicit_clean_other + explicit_clean_other_writer name, disp_name when :yes_other yes_other_writer name, disp_name when :csv @@ -782,8 +782,8 @@ EOC inherit_convert_attr_reader name when :uri uri_convert_attr_reader name - when :yes_clean_other - yes_clean_other_attr_reader name + when :explicit_clean_other + explicit_clean_other_attr_reader name when :yes_other yes_other_attr_reader name when :csv diff --git a/lib/rss/utils.rb b/lib/rss/utils.rb index ce7dbf1b02..9203df9a9b 100644 --- a/lib/rss/utils.rb +++ b/lib/rss/utils.rb @@ -125,16 +125,16 @@ module RSS [true, false].include?(args[0]) and args[1].is_a?(Hash) end - module YesCleanOther + module ExplicitCleanOther module_function def parse(value) if [true, false, nil].include?(value) value else case value.to_s - when /\Ayes\z/i + when /\Aexplicit|yes|true\z/i true - when /\Aclean\z/i + when /\Aclean|no|false\z/i false else nil |