Permalink
Browse files

Remove unnecessary patching of TrueClass and FalseClass

  • Loading branch information...
1 parent 87290cf commit d6f19c3b4c130e508997746eacb2b68bd2c7abc7 @reagent committed Jan 25, 2011
View
@@ -13,7 +13,6 @@
require 'fleakr/support'
require 'fleakr/api'
-require 'fleakr/core_ext'
require 'fleakr/objects'
# = Fleakr: A small, yet powerful, gem to interface with Flickr photostreams
@@ -108,7 +108,13 @@ def family?
# Hash representation of photo permissions
#
def to_hash
- {:is_public => public?.to_i, :is_friend => friends?.to_i, :is_family => family?.to_i}
+ {:is_public => to_i(public?), :is_friend => to_i(friends?), :is_family => to_i(family?)}
+ end
+
+ private
+
+ def to_i(boolean)
+ boolean ? 1 : 0
end
end
@@ -1,2 +0,0 @@
-require 'fleakr/core_ext/false_class'
-require 'fleakr/core_ext/true_class'
@@ -1,7 +0,0 @@
-class FalseClass # :nodoc:
-
- def to_i
- 0
- end
-
-end
@@ -1,7 +0,0 @@
-class TrueClass # :nodoc:
-
- def to_i
- 1
- end
-
-end
@@ -1,13 +0,0 @@
-require File.expand_path('../../../../test_helper', __FILE__)
-
-class FalseClassTest < Test::Unit::TestCase
-
- context "An instance of the FalseClass class" do
-
- should "have 0 as its integer value" do
- false.to_i.should == 0
- end
-
- end
-
-end
@@ -1,13 +0,0 @@
-require File.expand_path('../../../../test_helper', __FILE__)
-
-class TrueClassTest < Test::Unit::TestCase
-
- context "An instance of the TrueClass class" do
-
- should "have 1 as its integer value" do
- true.to_i.should == 1
- end
-
- end
-
-end

0 comments on commit d6f19c3

Please sign in to comment.