smooth_operator 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -103,17 +103,29 @@ module SmoothOperator
103
103
 
104
104
  attr_writer :endpoint
105
105
  def endpoint
106
- @endpoint ||= ENV["API_ENDPOINT"]
106
+ if defined?(@endpoint)
107
+ @endpoint
108
+ else
109
+ @endpoint = superclass_responds_to?(:endpoint) ? superclass.endpoint : ENV["API_ENDPOINT"]
110
+ end
107
111
  end
108
112
 
109
113
  attr_writer :endpoint_user
110
114
  def endpoint_user
111
- @endpoint_user ||= ENV["API_USER"]
115
+ if defined?(@endpoint_user)
116
+ @endpoint_user
117
+ else
118
+ @endpoint_user = superclass_responds_to?(:endpoint_user) ? superclass.endpoint_user : ENV["API_USER"]
119
+ end
112
120
  end
113
121
 
114
122
  attr_writer :endpoint_pass
115
123
  def endpoint_pass
116
- @endpoint_pass ||= ENV["API_PASS"]
124
+ if defined?(@endpoint_pass)
125
+ @endpoint_pass
126
+ else
127
+ @endpoint_pass = superclass_responds_to?(:endpoint_pass) ? superclass.endpoint_pass : ENV["API_PASS"]
128
+ end
117
129
  end
118
130
 
119
131
  attr_writer :save_attr_black_list
@@ -142,6 +154,10 @@ module SmoothOperator
142
154
 
143
155
  private ################################ PRIVATE #########################
144
156
 
157
+ def superclass_responds_to?(method_name)
158
+ superclass.name.split('::')[0] != 'SmoothOperator' && superclass.respond_to?(method_name)
159
+ end
160
+
145
161
  def build_url(relative_path)
146
162
  slash = '/' if relative_path.present?
147
163
  extention = '.json'
@@ -1,3 +1,3 @@
1
1
  module SmoothOperator
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smooth_operator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.6
4
+ version: 0.3.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-09-02 00:00:00.000000000 Z
12
+ date: 2013-09-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler