Module: RSS::Utils::ExplicitCleanOther

Defined in:
lib/rss/utils.rb

Class Method Summary collapse

Class Method Details

.parse(value) ⇒ Object



112
113
114
115
116
117
118
119
120
121
122
123
124
125
# File 'lib/rss/utils.rb', line 112

def parse(value)
  if [true, false, nil].include?(value)
    value
  else
    case value.to_s
    when /\Aexplicit|yes|true\z/i
      true
    when /\Aclean|no|false\z/i
      false
    else
      nil
    end
  end
end