Module: Bcome::Node::Attributes
- Included in:
- Base
- Defined in:
- lib/objects/node/attributes.rb
Instance Method Summary collapse
-
#filters ⇒ Object
From 2.0.0 onwards, filters can be loaded from the network block only.
-
#identifier ⇒ Object
– Attributes –.
- #network_data ⇒ Object
- #network_driver ⇒ Object
- #recurse_hash_data_for_instance_key(instance_key, parent_key) ⇒ Object
- #ssh_data ⇒ Object
- #ssh_driver ⇒ Object
- #ssh_driver=(alternative_ssh_driver) ⇒ Object
Instance Method Details
#filters ⇒ Object
From 2.0.0 onwards, filters can be loaded from the network block only. The older key, ‘ec2_filters’ is retained at this level for backwards compatibility.
28 29 30 |
# File 'lib/objects/node/attributes.rb', line 28 def filters recurse_hash_data_for_instance_key(:ec2_filters, :filters) end |
#identifier ⇒ Object
– Attributes –
6 7 8 |
# File 'lib/objects/node/attributes.rb', line 6 def identifier @identifier end |
#network_data ⇒ Object
22 23 24 |
# File 'lib/objects/node/attributes.rb', line 22 def network_data recurse_hash_data_for_instance_key(:network, :network_data) end |
#network_driver ⇒ Object
32 33 34 35 36 37 |
# File 'lib/objects/node/attributes.rb', line 32 def network_driver return nil if !network_data || (network_data.is_a?(Hash) && network_data.empty?) @network_driver ||= ::Bcome::Driver::Bucket.instance.driver_for_network_data(network_data, self) @network_driver end |
#recurse_hash_data_for_instance_key(instance_key, parent_key) ⇒ Object
39 40 41 42 43 44 |
# File 'lib/objects/node/attributes.rb', line 39 def recurse_hash_data_for_instance_key(instance_key, parent_key) instance_data = respond_to?(instance_key) ? send(instance_key) : {} instance_data ||= {} instance_data = parent.send(parent_key).deep_merge(instance_data) if has_parent? instance_data end |
#ssh_data ⇒ Object
18 19 20 |
# File 'lib/objects/node/attributes.rb', line 18 def ssh_data recurse_hash_data_for_instance_key(:ssh_settings, :ssh_data) end |
#ssh_driver ⇒ Object
14 15 16 |
# File 'lib/objects/node/attributes.rb', line 14 def ssh_driver @ssh_driver ||= ::Bcome::Ssh::Driver.new(ssh_data, self) end |
#ssh_driver=(alternative_ssh_driver) ⇒ Object
10 11 12 |
# File 'lib/objects/node/attributes.rb', line 10 def ssh_driver=(alternative_ssh_driver) @ssh_driver = alternative_ssh_driver end |