Class: CloudConfig::ProviderOptions
- Inherits:
-
Object
- Object
- CloudConfig::ProviderOptions
- Defined in:
- lib/cloud-config/provider_options.rb
Overview
A helper class for storing provider options.
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
-
#preload ⇒ Object
readonly
Returns the value of attribute preload.
Instance Method Summary collapse
-
#async_preload? ⇒ Boolean
Returns whether asynchronous preloading is enabled for the provider.
-
#initialize(params = {}) ⇒ ProviderOptions
constructor
Create a new instance of ProviderOptions.
-
#to_h ⇒ Hash<Symbol,Object>
Returns the class in the form of a hash.
Constructor Details
#initialize(params = {}) ⇒ ProviderOptions
Create a new instance of CloudConfig::ProviderOptions.
12 13 14 15 |
# File 'lib/cloud-config/provider_options.rb', line 12 def initialize(params = {}) @preload = params[:preload] @klass = params[:class] end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
6 7 8 |
# File 'lib/cloud-config/provider_options.rb', line 6 def klass @klass end |
#preload ⇒ Object (readonly)
Returns the value of attribute preload.
6 7 8 |
# File 'lib/cloud-config/provider_options.rb', line 6 def preload @preload end |
Instance Method Details
#async_preload? ⇒ Boolean
Returns whether asynchronous preloading is enabled for the provider.
20 21 22 23 24 |
# File 'lib/cloud-config/provider_options.rb', line 20 def async_preload? return false unless preload.is_a?(Hash) preload[:async] end |
#to_h ⇒ Hash<Symbol,Object>
Returns the class in the form of a hash
29 30 31 |
# File 'lib/cloud-config/provider_options.rb', line 29 def to_h { preload:, class: klass } end |