Class: Aliyun::Service
- Inherits:
-
Object
- Object
- Aliyun::Service
- Defined in:
- lib/aliyun_ruby_api/service.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.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Service
constructor
A new instance of Service.
-
#method_missing(method_name, *args) ⇒ Object
The method entry to call ECS url method.
Constructor Details
#initialize(options = {}) ⇒ Service
Returns a new instance of Service.
26 27 28 29 30 31 32 33 34 35 |
# File 'lib/aliyun_ruby_api/service.rb', line 26 def initialize(={}) self.access_key_id = [:access_key_id] || $ACCESS_KEY_ID || "" self.access_key_secret = [:access_key_secret] || $ACCESS_KEY_SECRET || "" self.endpoint_url = [:endpoint_url] || $ENDPOINT_URL || ALIYUN_API_ENDPOINT self. = {:AccessKeyId => self.access_key_id} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object
The method entry to call ECS url method
38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/aliyun_ruby_api/service.rb', line 38 def method_missing(method_name, *args) if $DEBUG puts "Not Found Method: #{method_name}" end if args[0].nil? raise AliyunAPIException.new "No such method #{method_name}!" end call_aliyun_with_parameter(method_name, args[0]) end |
Instance Attribute Details
#access_key_id ⇒ Object
Returns the value of attribute access_key_id.
20 21 22 |
# File 'lib/aliyun_ruby_api/service.rb', line 20 def access_key_id @access_key_id end |
#access_key_secret ⇒ Object
Returns the value of attribute access_key_secret.
22 23 24 |
# File 'lib/aliyun_ruby_api/service.rb', line 22 def access_key_secret @access_key_secret end |
#endpoint_url ⇒ Object
Returns the value of attribute endpoint_url.
24 25 26 |
# File 'lib/aliyun_ruby_api/service.rb', line 24 def endpoint_url @endpoint_url end |
#options ⇒ Object
Returns the value of attribute options.
18 19 20 |
# File 'lib/aliyun_ruby_api/service.rb', line 18 def end |