diff options
author | Florian Frank <flori@ping.de> | 2014-07-03 10:47:44 +0200 |
---|---|---|
committer | Florian Frank <flori@ping.de> | 2014-07-03 10:48:45 +0200 |
commit | 54c8e4978264092090b354ff5f656e4a80bb6178 (patch) | |
tree | 47bdfce495a748546d15e6acd046f23d53ff52cd /lib | |
parent | eede80ffc99f181db2b6610b2ce7fd144855b74a (diff) | |
download | json-54c8e4978264092090b354ff5f656e4a80bb6178.tar.gz |
Reindented
Diffstat (limited to 'lib')
-rw-r--r-- | lib/json/add/rational.rb | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/json/add/rational.rb b/lib/json/add/rational.rb index c100d13..ee39c20 100644 --- a/lib/json/add/rational.rb +++ b/lib/json/add/rational.rb @@ -4,9 +4,8 @@ end defined?(::Rational) or require 'rational' class Rational - - # Deserializes JSON string by converting numerator value <tt>n</tt>, denominator - # value <tt>d</tt>, to a Rational object. + # Deserializes JSON string by converting numerator value <tt>n</tt>, + # denominator value <tt>d</tt>, to a Rational object. def self.json_create(object) Rational(object['n'], object['d']) end @@ -15,9 +14,9 @@ class Rational # object. def as_json(*) { - JSON.create_id => self.class.name, - 'n' => numerator, - 'd' => denominator, + JSON.create_id => self.class.name, + 'n' => numerator, + 'd' => denominator, } end @@ -25,4 +24,4 @@ class Rational def to_json(*) as_json.to_json end -end
\ No newline at end of file +end |