def value
if !data.empty?
data[:encoding] == 'base64' ? Base64.decode64(@text.strip) : data
elsif @text.nil?
rules[:type] == :boolean ? false : nil
else
case rules[:type]
when nil, :string then @text
when :datetime then datetime_like_value(DateTime, :civil)
when :time then datetime_like_value(Time, :utc)
when :integer then @text.to_i
when :float then @text.to_f
when :boolean then @text == 'true'
when :blob then Base64.decode64(@text)
when :symbol then Core::Inflection.ruby_name(@text).to_sym
else raise "unhandled type"
end
end
end