Class: BrickFTP::Client
- Inherits:
-
Object
- Object
- BrickFTP::Client
- Defined in:
- lib/brick_ftp/client.rb
Overview
To delegate commands.
Instance Attribute Summary collapse
-
#api_client ⇒ Object
readonly
Returns the value of attribute api_client.
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#subdomain ⇒ Object
readonly
Returns the value of attribute subdomain.
Instance Method Summary collapse
-
#initialize(subdomain: nil, api_key: nil) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(subdomain: nil, api_key: nil) ⇒ Client
Returns a new instance of Client.
17 18 19 20 21 |
# File 'lib/brick_ftp/client.rb', line 17 def initialize(subdomain: nil, api_key: nil) @subdomain = subdomain || ENV['BRICK_FTP_SUBDOMAIN'] @api_key = api_key || ENV['BRICK_FTP_API_KEY'] @api_client = BrickFTP::RESTfulAPI::Client.new(@subdomain, @api_key) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args) ⇒ Object (private)
40 41 42 43 44 45 46 47 |
# File 'lib/brick_ftp/client.rb', line 40 def method_missing(name, *args) klass = command_class(name) if klass dispatch_command(klass, *args) else super end end |
Instance Attribute Details
#api_client ⇒ Object (readonly)
Returns the value of attribute api_client.
13 14 15 |
# File 'lib/brick_ftp/client.rb', line 13 def api_client @api_client end |
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
13 14 15 |
# File 'lib/brick_ftp/client.rb', line 13 def api_key @api_key end |
#subdomain ⇒ Object (readonly)
Returns the value of attribute subdomain.
13 14 15 |
# File 'lib/brick_ftp/client.rb', line 13 def subdomain @subdomain end |