Class: Aliyun::Service
- Inherits:
-
Object
- Object
- Aliyun::Service
- Defined in:
- lib/aliyun/common.rb
Instance Attribute Summary collapse
-
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
-
#access_key_secret ⇒ Object
Returns the value of attribute access_key_secret.
-
#endpoint_url ⇒ Object
Returns the value of attribute endpoint_url.
-
#options ⇒ Object
Returns the value of attribute options.
-
#service ⇒ Object
Returns the value of attribute service.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Service
constructor
A new instance of Service.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Service
Returns a new instance of Service.
16 17 18 19 20 21 22 23 |
# File 'lib/aliyun/common.rb', line 16 def initialize(={}) [:service] ||= :ecs self.service = SERVICES[[:service].to_sym] self.access_key_id = [:access_key_id] self.access_key_secret = [:access_key_secret] self.endpoint_url = [:endpoint_url] || self.service.endpoint self. = {:AccessKeyId => self.access_key_id} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/aliyun/common.rb', line 25 def method_missing(method, *args) if $DEBUG puts "Not Found Method: #{method}" end if args[0].nil? raise AliyunAPIException.new "Method missing: #{method}!" end call_aliyun_with_parameter(method, args[0]) end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
11 12 13 |
# File 'lib/aliyun/common.rb', line 11 def access_key_id @access_key_id end |
#access_key_secret ⇒ Object
Returns the value of attribute access_key_secret.
11 12 13 |
# File 'lib/aliyun/common.rb', line 11 def access_key_secret @access_key_secret end |
#endpoint_url ⇒ Object
Returns the value of attribute endpoint_url.
13 14 15 |
# File 'lib/aliyun/common.rb', line 13 def endpoint_url @endpoint_url end |
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/aliyun/common.rb', line 12 def @options end |
#service ⇒ Object
Returns the value of attribute service.
14 15 16 |
# File 'lib/aliyun/common.rb', line 14 def service @service end |