to_api 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module ToApi
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
data/lib/to_api.rb CHANGED
@@ -3,7 +3,7 @@ module ToApiSelf
3
3
  self
4
4
  end
5
5
  end
6
- [ Fixnum, String, DateTime, Date, Time, NilClass ].each do |klass|
6
+ [ Fixnum, String, DateTime, Date, Time, NilClass, TrueClass, FalseClass ].each do |klass|
7
7
  klass.send(:include, ToApiSelf)
8
8
  end
9
9
 
data/spec/to_api_spec.rb CHANGED
@@ -110,6 +110,26 @@ describe '#to_api' do
110
110
  end
111
111
  end
112
112
 
113
+ describe TrueClass do
114
+ it "returns self" do
115
+ true.to_api.should == true
116
+ end
117
+ describe "ingoring includes" do
118
+ let(:instance) { true }
119
+ it_should_behave_like "ignoring includes"
120
+ end
121
+ end
122
+
123
+ describe FalseClass do
124
+ it "returns self" do
125
+ false.to_api.should == false
126
+ end
127
+ describe "ingoring includes" do
128
+ let(:instance) { false }
129
+ it_should_behave_like "ignoring includes"
130
+ end
131
+ end
132
+
113
133
  describe ActiveRecord::NamedScope::Scope do
114
134
  it "returns to_api of its kids" do
115
135
  FakeRecord.should_receive(:reflect_on_all_associations).and_return([mock(:name => "fake_child_records")])
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: to_api
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 2
10
- version: 1.1.2
9
+ - 3
10
+ version: 1.1.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Shawn Anderson
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-01-18 00:00:00 -05:00
19
+ date: 2011-06-07 00:00:00 -04:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency