Class: Cyoi::Cli::Providers::ProviderCli
- Inherits:
-
Object
- Object
- Cyoi::Cli::Providers::ProviderCli
- Defined in:
- lib/cyoi/cli/providers/provider_cli.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
-
#hl ⇒ Object
readonly
Returns the value of attribute hl.
Instance Method Summary collapse
- #display_confirmation ⇒ Object
-
#export_attributes ⇒ Object
helper to export the complete nested attributes.
-
#initialize(attributes, highline) ⇒ ProviderCli
constructor
A new instance of ProviderCli.
- #say(message, *args) ⇒ Object
-
#valid_infrastructure? ⇒ Boolean
Only a subclass can represent valid infrastruct If using this class directly, then it has not yet decided which provider/infrastructure to use.
Constructor Details
#initialize(attributes, highline) ⇒ ProviderCli
Returns a new instance of ProviderCli.
7 8 9 10 11 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 7 def initialize(attributes, highline) @hl = highline @attributes = attributes.is_a?(Hash) ? ReadWriteSettings.new(attributes) : attributes raise "@attributes must be ReadWriteSettings (or Hash)" unless @attributes.is_a?(ReadWriteSettings) end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
4 5 6 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 4 def attributes @attributes end |
#hl ⇒ Object (readonly)
Returns the value of attribute hl.
5 6 7 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 5 def hl @hl end |
Instance Method Details
#display_confirmation ⇒ Object
25 26 27 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 25 def display_confirmation raise "please implement in subclass" end |
#export_attributes ⇒ Object
helper to export the complete nested attributes.
14 15 16 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 14 def export_attributes attributes.to_nested_hash end |
#say(message, *args) ⇒ Object
29 30 31 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 29 def say(, *args) puts() end |
#valid_infrastructure? ⇒ Boolean
Only a subclass can represent valid infrastruct If using this class directly, then it has not yet decided which provider/infrastructure to use
21 22 23 |
# File 'lib/cyoi/cli/providers/provider_cli.rb', line 21 def valid_infrastructure? false end |