lib/code/ruby.rb in code-ruby-0.4.0 vs lib/code/ruby.rb in code-ruby-0.5.0
- old
+ new
@@ -29,19 +29,19 @@
::Code::Object::Decimal.new(raw.to_s)
elsif big_decimal?
::Code::Object::Decimal.new(raw)
elsif hash?
::Code::Object::Dictionnary.new(
- raw.map do |key, value|
- [::Code::Ruby.to_code(key), ::Code::Ruby.to_code(value)]
- end.to_h
+ raw
+ .map do |key, value|
+ [::Code::Ruby.to_code(key), ::Code::Ruby.to_code(value)]
+ end
+ .to_h
)
elsif array?
::Code::Object::List.new(
- raw.map do |element|
- ::Code::Ruby.to_code(key)
- end
+ raw.map { |element| ::Code::Ruby.to_code(key) }
)
elsif proc?
::Code::Object::RubyFunction.new(raw)
else
raise "Unsupported class #{raw.class} for Ruby to Code conversion"
@@ -61,16 +61,17 @@
elsif code_range?
raw.raw
elsif code_string?
raw.raw
elsif code_dictionnary?
- raw.raw.map do |key, value|
- [::Code::Ruby.to_code(key), ::Code::Ruby.to_code(value)]
- end.to_h
+ raw
+ .raw
+ .map do |key, value|
+ [::Code::Ruby.to_code(key), ::Code::Ruby.to_code(value)]
+ end
+ .to_h
elsif code_list?
- raw.raw.map do |element|
- ::Code::Ruby.to_code(element)
- end
+ raw.raw.map { |element| ::Code::Ruby.to_code(element) }
else
raise "Unsupported class #{raw.class} for Code to Ruby conversion"
end
else
raw