Class: Aliyun::Odps::ServiceObject
- Inherits:
-
Object
- Object
- Aliyun::Odps::ServiceObject
show all
- Defined in:
- lib/aliyun/odps/service_object.rb
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(master, _options = {}) ⇒ ServiceObject
Returns a new instance of ServiceObject.
14
15
16
|
# File 'lib/aliyun/odps/service_object.rb', line 14
def initialize(master, _options = {})
@master = master
end
|
Instance Attribute Details
#master ⇒ Object
Returns the value of attribute master.
12
13
14
|
# File 'lib/aliyun/odps/service_object.rb', line 12
def master
@master
end
|
Class Method Details
.build(master, options = {}) ⇒ Object
22
23
24
|
# File 'lib/aliyun/odps/service_object.rb', line 22
def self.build(master, options = {})
service_pool[master] ||= new(master, options)
end
|
.service_pool ⇒ Object
18
19
20
|
# File 'lib/aliyun/odps/service_object.rb', line 18
def self.service_pool
@service_pool ||= {}
end
|
Instance Method Details
#client ⇒ Object
4
5
6
|
# File 'lib/aliyun/odps/service_object.rb', line 4
def client
master.is_a?(Client) ? master : project.client
end
|
#project ⇒ Object
8
9
10
|
# File 'lib/aliyun/odps/service_object.rb', line 8
def project
@master.is_a?(Project) ? @master : @master.try(:project)
end
|