diff options
Diffstat (limited to 'lib/sisu/v3/param.rb')
-rw-r--r-- | lib/sisu/v3/param.rb | 46 |
1 files changed, 23 insertions, 23 deletions
diff --git a/lib/sisu/v3/param.rb b/lib/sisu/v3/param.rb index 7a416bd9..64baf271 100644 --- a/lib/sisu/v3/param.rb +++ b/lib/sisu/v3/param.rb @@ -165,10 +165,10 @@ module SiSU_Param end def validate_length(s,l,n) #s=(s.length <= l) ? s : nil - s=if s.class==String \ + s=if s.is_a?(String) \ and s.length <= l s - elsif s.class==NilClass + elsif s.is_a?(NilClass) nil elsif s.class !=String STDERR.puts "#{n} is #{s.class}: programming error, String expected #{__FILE__}:#{__LINE__}" @@ -308,7 +308,7 @@ module SiSU_Param names=@h['editor'] \ ? name_format(@h['editor']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -321,7 +321,7 @@ module SiSU_Param names=@h['editor'] \ ? name_format(@h['editor']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -329,7 +329,7 @@ module SiSU_Param names=@h['contributor'] \ ? name_format(@h['contributor']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -342,7 +342,7 @@ module SiSU_Param names=@h['contributor'] \ ? name_format(@h['contributor']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -350,7 +350,7 @@ module SiSU_Param names=@h['illustrator'] \ ? name_format(@h['illustrator']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -363,7 +363,7 @@ module SiSU_Param names=@h['illustrator'] \ ? name_format(@h['illustrator']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -371,7 +371,7 @@ module SiSU_Param names=@h['photographer'] \ ? name_format(@h['photographer']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -384,7 +384,7 @@ module SiSU_Param names=@h['photographer'] \ ? name_format(@h['photographer']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -392,7 +392,7 @@ module SiSU_Param names=@h['translator'] \ ? name_format(@h['translator']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -405,7 +405,7 @@ module SiSU_Param names=@h['translator'] \ ? name_format(@h['translator']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -413,7 +413,7 @@ module SiSU_Param names=@h['audio'] \ ? name_format(@h['audio']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -426,7 +426,7 @@ module SiSU_Param names=@h['audio'] \ ? name_format(@h['audio']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -434,7 +434,7 @@ module SiSU_Param names=@h['digitized_by'] \ ? name_format(@h['digitized_by']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -447,7 +447,7 @@ module SiSU_Param names=@h['digitized_by'] \ ? name_format(@h['digitized_by']) : nil - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -455,7 +455,7 @@ module SiSU_Param names=@h['prepared_by'] \ ? name_format(@h['prepared_by']) : nil - s=(names.class==Hash) \ + s=(names.is_a?(Hash)) \ ? names[:name_str] : nil s=if s @@ -469,7 +469,7 @@ module SiSU_Param ? name_format(@h['prepared_by']) : nil names=name_format(@h['prepared_by']) - (names.class==Hash) \ + (names.is_a?(Hash)) \ ? names[:name_a_h] : nil end @@ -1186,7 +1186,7 @@ module SiSU_Param SiSU_Screen::Ansi.new(@opt.cmd,'No SiSU markup version provided').warn if @opt.cmd =~/[VM]/ end else - mv=if defined? @markup_version.determined and not @markup_version.determined.nil? + mv=if @markup_version.determined.is_a?(Float) x=@markup_version.determined "markup version determined #{x}" else '' @@ -1406,17 +1406,17 @@ module SiSU_Param @ec[:multimedia]=@ec[:multimedia].uniq.flatten.sort unless @rights if defined? @creator.author \ - and @creator.author \ + and @creator.author.is_a?(String) \ and defined? @date.published \ - and @date.published + and @date.published.is_a?(String) @rights=SiSU_Param::Parameters::MdDefault.new.rights(@creator.author,@date.published) elsif defined? @creator.author \ - and @creator.author + and @creator.author.is_a?(String) @rights=SiSU_Param::Parameters::MdDefault.new.rights("[#{@creator.author}]",'') end end if defined? @classify.topic_register \ - and not @classify.topic_register.nil? \ + and @classify.topic_register.is_a?(String) \ and @classify.topic_register.length >3 topic_register=@classify.topic_register u=topic_register.scan(/[^;]+/) |