Class: Runcible::Instance
- Inherits:
-
Object
- Object
- Runcible::Instance
- Defined in:
- lib/runcible/instance.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#extensions ⇒ Object
Returns the value of attribute extensions.
-
#resources ⇒ Object
Returns the value of attribute resources.
Class Method Summary collapse
- .extension_classes ⇒ Object
-
.resource_classes ⇒ Object
rubocop:disable Style/ClassVars.
Instance Method Summary collapse
-
#initialize(config = {}) ⇒ Instance
constructor
Initialize a Runcible instance.
-
#update_config(key, value) ⇒ Object
Update an existing config value.
Constructor Details
#initialize(config = {}) ⇒ Instance
Initialize a Runcible instance
30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/runcible/instance.rb', line 30 def initialize(config = {}) @config = { :api_path => '/pulp/api/v2/', :url => 'https://localhost', :user => '', :http_auth => {:password => {} }, :headers => {:content_type => 'application/json', :accept => 'application/json'}, :logging => {} }.merge(config).with_indifferent_access initialize_wrappers end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
51 52 53 |
# File 'lib/runcible/instance.rb', line 51 def config @config end |
#extensions ⇒ Object
Returns the value of attribute extensions.
15 16 17 |
# File 'lib/runcible/instance.rb', line 15 def extensions @extensions end |
#resources ⇒ Object
Returns the value of attribute resources.
14 15 16 |
# File 'lib/runcible/instance.rb', line 14 def resources @resources end |
Class Method Details
.extension_classes ⇒ Object
9 10 11 12 |
# File 'lib/runcible/instance.rb', line 9 def self.extension_classes @@extension_classes ||= gather_classes('extensions') @@extension_classes end |
.resource_classes ⇒ Object
rubocop:disable Style/ClassVars
4 5 6 7 |
# File 'lib/runcible/instance.rb', line 4 def self.resource_classes @@resource_classes ||= gather_classes('resources') @@resource_classes end |
Instance Method Details
#update_config(key, value) ⇒ Object
Update an existing config value
47 48 49 |
# File 'lib/runcible/instance.rb', line 47 def update_config(key, value) @config[key] = value end |