summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorFlorian Frank <flori@ping.de>2014-07-03 10:47:44 +0200
committerFlorian Frank <flori@ping.de>2015-01-02 23:48:12 +0100
commit3869d77136f039bba2e11e35949cafc5dc662db3 (patch)
treefabeee0340431c351589b7a7d714ad49877502bb /lib
parent1f339fe8d3fd015886d09c06806ddcd128ecf810 (diff)
downloadjson-3869d77136f039bba2e11e35949cafc5dc662db3.tar.gz
Reindented
Diffstat (limited to 'lib')
-rw-r--r--lib/json/add/rational.rb13
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