harpy 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -191,12 +191,15 @@ module Harpy
191
191
  Harpy.client.invalid_code response
192
192
  end
193
193
  end
194
-
194
+
195
195
  def method_missing(method, *args)
196
- if persisted? && !@attrs.has_key?(method.to_s)
196
+ key = method.to_s
197
+ if persisted? && !@attrs.has_key?(key)
198
+ super
199
+ elsif key=~/[\]=]\z/
197
200
  super
198
201
  else
199
- @attrs[method.to_s]
202
+ @attrs[key]
200
203
  end
201
204
  end
202
205
  end
data/lib/harpy/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Harpy
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
@@ -256,7 +256,8 @@ describe "class including Harpy::Resource" do
256
256
  end
257
257
  it "doesn't define writers for each attribute" do
258
258
  company = Harpy::Spec::Company.new "name" => "Harpy Ltd"
259
- company.should_not respond_to(:name=)
259
+ lambda{ company.name = "test" }.should raise_error NoMethodError
260
+ lambda{ company[1] }.should raise_error NoMethodError
260
261
  end
261
262
  it "allows accessing undefined attributes when not persisted" do
262
263
  subject.name.should be_nil
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: harpy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,12 +10,12 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-07-03 00:00:00.000000000 +02:00
13
+ date: 2011-07-20 00:00:00.000000000 +02:00
14
14
  default_executable:
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: typhoeus
18
- requirement: &2169825280 !ruby/object:Gem::Requirement
18
+ requirement: &2164769540 !ruby/object:Gem::Requirement
19
19
  none: false
20
20
  requirements:
21
21
  - - ~>
@@ -23,10 +23,10 @@ dependencies:
23
23
  version: 0.2.4
24
24
  type: :runtime
25
25
  prerelease: false
26
- version_requirements: *2169825280
26
+ version_requirements: *2164769540
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: activesupport
29
- requirement: &2169824760 !ruby/object:Gem::Requirement
29
+ requirement: &2164769020 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
32
  - - ! '>='
@@ -34,10 +34,10 @@ dependencies:
34
34
  version: 3.0.0
35
35
  type: :runtime
36
36
  prerelease: false
37
- version_requirements: *2169824760
37
+ version_requirements: *2164769020
38
38
  - !ruby/object:Gem::Dependency
39
39
  name: activemodel
40
- requirement: &2169824280 !ruby/object:Gem::Requirement
40
+ requirement: &2164768540 !ruby/object:Gem::Requirement
41
41
  none: false
42
42
  requirements:
43
43
  - - ! '>='
@@ -45,10 +45,10 @@ dependencies:
45
45
  version: 3.0.0
46
46
  type: :runtime
47
47
  prerelease: false
48
- version_requirements: *2169824280
48
+ version_requirements: *2164768540
49
49
  - !ruby/object:Gem::Dependency
50
50
  name: hash-deep-merge
51
- requirement: &2169823800 !ruby/object:Gem::Requirement
51
+ requirement: &2155977780 !ruby/object:Gem::Requirement
52
52
  none: false
53
53
  requirements:
54
54
  - - ~>
@@ -56,10 +56,10 @@ dependencies:
56
56
  version: 0.1.1
57
57
  type: :runtime
58
58
  prerelease: false
59
- version_requirements: *2169823800
59
+ version_requirements: *2155977780
60
60
  - !ruby/object:Gem::Dependency
61
61
  name: yajl-ruby
62
- requirement: &2169823320 !ruby/object:Gem::Requirement
62
+ requirement: &2155977300 !ruby/object:Gem::Requirement
63
63
  none: false
64
64
  requirements:
65
65
  - - ~>
@@ -67,10 +67,10 @@ dependencies:
67
67
  version: 0.8.2
68
68
  type: :runtime
69
69
  prerelease: false
70
- version_requirements: *2169823320
70
+ version_requirements: *2155977300
71
71
  - !ruby/object:Gem::Dependency
72
72
  name: rake
73
- requirement: &2169822840 !ruby/object:Gem::Requirement
73
+ requirement: &2155976820 !ruby/object:Gem::Requirement
74
74
  none: false
75
75
  requirements:
76
76
  - - ~>
@@ -78,10 +78,10 @@ dependencies:
78
78
  version: 0.8.7
79
79
  type: :development
80
80
  prerelease: false
81
- version_requirements: *2169822840
81
+ version_requirements: *2155976820
82
82
  - !ruby/object:Gem::Dependency
83
83
  name: rspec
84
- requirement: &2169822360 !ruby/object:Gem::Requirement
84
+ requirement: &2155976340 !ruby/object:Gem::Requirement
85
85
  none: false
86
86
  requirements:
87
87
  - - ~>
@@ -89,10 +89,10 @@ dependencies:
89
89
  version: 2.6.0
90
90
  type: :development
91
91
  prerelease: false
92
- version_requirements: *2169822360
92
+ version_requirements: *2155976340
93
93
  - !ruby/object:Gem::Dependency
94
94
  name: rocco
95
- requirement: &2169821880 !ruby/object:Gem::Requirement
95
+ requirement: &2155975860 !ruby/object:Gem::Requirement
96
96
  none: false
97
97
  requirements:
98
98
  - - ~>
@@ -100,7 +100,7 @@ dependencies:
100
100
  version: '0.7'
101
101
  type: :development
102
102
  prerelease: false
103
- version_requirements: *2169821880
103
+ version_requirements: *2155975860
104
104
  description: Client for REST API with HATEOAS
105
105
  email:
106
106
  - joseph.halter@thetalentbox.com