Class: Niso::Cloud
- Inherits:
-
Object
- Object
- Niso::Cloud
- Includes:
- Utility
- Defined in:
- lib/niso.rb,
lib/niso/cloud.rb,
lib/niso/cloud/base.rb,
lib/niso/cloud/droplet_kit.rb
Defined Under Namespace
Classes: Base, DropletKit
Instance Method Summary collapse
-
#initialize(cli, provider) ⇒ Cloud
constructor
A new instance of Cloud.
- #method_missing(sym, *args, &block) ⇒ Object
- #respond_to?(method) ⇒ Boolean
Methods included from Utility
Constructor Details
#initialize(cli, provider) ⇒ Cloud
Returns a new instance of Cloud.
5 6 7 8 9 10 11 12 |
# File 'lib/niso/cloud.rb', line 5 def initialize(cli, provider) @subject = case provider when 'do' Niso::Cloud::DropletKit.new(cli, provider) else abort_with "Provider #{provider} is not valid!" end end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(sym, *args, &block) ⇒ Object
14 15 16 |
# File 'lib/niso/cloud.rb', line 14 def method_missing(sym, *args, &block) @subject.send sym, *args, &block end |
Instance Method Details
#respond_to?(method) ⇒ Boolean
18 19 20 |
# File 'lib/niso/cloud.rb', line 18 def respond_to?(method) @subject.respond_to?(sym) || super end |