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
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/runcible/instance.rb', line 19 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.
40 41 42 |
# File 'lib/runcible/instance.rb', line 40 def config @config end |
#extensions ⇒ Object
Returns the value of attribute extensions.
4 5 6 |
# File 'lib/runcible/instance.rb', line 4 def extensions @extensions end |
#resources ⇒ Object
Returns the value of attribute resources.
3 4 5 |
# File 'lib/runcible/instance.rb', line 3 def resources @resources end |
Class Method Details
.extension_classes ⇒ Object
49 50 51 52 |
# File 'lib/runcible/instance.rb', line 49 def extension_classes @@extension_classes ||= gather_classes('extensions') @@extension_classes end |
.resource_classes ⇒ Object
rubocop:disable Style/ClassVars
44 45 46 47 |
# File 'lib/runcible/instance.rb', line 44 def resource_classes @@resource_classes ||= gather_classes('resources') @@resource_classes end |
Instance Method Details
#update_config(key, value) ⇒ Object
Update an existing config value
36 37 38 |
# File 'lib/runcible/instance.rb', line 36 def update_config(key, value) @config[key] = value end |