zertico 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,19 +1,19 @@
1
1
  module Zertico
2
2
  module Service
3
3
  def all
4
- instance_variable_set("@#{interface_name.pluralize}", resource.all)
4
+ instance_variable_set("@#{interface_name.pluralize}", resource_source.all)
5
5
  end
6
6
 
7
7
  def build
8
- instance_variable_set("@#{interface_name}", resource.new)
8
+ instance_variable_set("@#{interface_name}", resource_source.new)
9
9
  end
10
10
 
11
11
  def find
12
- instance_variable_set("@#{interface_name}", resource.find(params[interface_id.to_sym]))
12
+ instance_variable_set("@#{interface_name}", resource_source.find(params[interface_id.to_sym]))
13
13
  end
14
14
 
15
15
  def generate
16
- instance_variable_set("@#{interface_name}", resource.create(params[interface_name.to_sym]))
16
+ instance_variable_set("@#{interface_name}", resource_source.create(params[interface_name.to_sym]))
17
17
  end
18
18
 
19
19
  def modify
@@ -28,15 +28,15 @@ module Zertico
28
28
  instance_variable_get("@#{interface_name}")
29
29
  end
30
30
 
31
- def resource
32
- @resource_object ||= interface_class
31
+ def resource_source
32
+ @resource_source ||= interface_class
33
33
  end
34
34
 
35
- def resource=(resource_chain = [])
36
- @resource_object = resource_chain.shift
37
- @resource_object = @resource_object.constantize if @resource_object.respond_to?(:constantize)
35
+ def resource_source=(resource_chain = [])
36
+ @resource_source = resource_chain.shift
37
+ @resource_source = @resource_source.constantize if @resource_source.respond_to?(:constantize)
38
38
  resource_chain.each do |resource|
39
- @resource_object = @resource_object.send(resource)
39
+ @resource_source = @resource_source.send(resource)
40
40
  end
41
41
  end
42
42
 
@@ -1,3 +1,3 @@
1
1
  module Zertico
2
- VERSION = '1.1.0'
2
+ VERSION = '1.1.1'
3
3
  end
@@ -127,24 +127,24 @@ describe Zertico::Service do
127
127
  end
128
128
  end
129
129
 
130
- context '#resource' do
130
+ context '#resource_source' do
131
131
  context 'with no resource defined' do
132
132
  before :each do
133
133
  controller.stub(:interface_class => User)
134
134
  end
135
135
 
136
136
  it 'should return the resource' do
137
- controller.resource.should == User
137
+ controller.resource_source.should == User
138
138
  end
139
139
  end
140
140
 
141
141
  context 'with a resource defined' do
142
142
  before :each do
143
- controller.resource = %w(Person::Profile)
143
+ controller.resource_source = %w(Person::Profile)
144
144
  end
145
145
 
146
146
  it 'should return the resource' do
147
- controller.resource.should == Person::Profile
147
+ controller.resource_source.should == Person::Profile
148
148
  end
149
149
  end
150
150
  end
@@ -152,11 +152,11 @@ describe Zertico::Service do
152
152
  context '#resource=' do
153
153
  before :each do
154
154
  User.stub(:all => [ object ])
155
- controller.resource = %w(User all)
155
+ controller.resource_source = %w(User all)
156
156
  end
157
157
 
158
158
  it 'should set the resource' do
159
- controller.resource.should == [ object ]
159
+ controller.resource_source.should == [ object ]
160
160
  end
161
161
  end
162
162
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zertico
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: -898163586098864558
118
+ hash: -2706871665374996323
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements:
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  segments:
126
126
  - 0
127
- hash: -898163586098864558
127
+ hash: -2706871665374996323
128
128
  requirements: []
129
129
  rubyforge_project:
130
130
  rubygems_version: 1.8.25