Class: Cipherpipe::ExternalSource
- Inherits:
-
Object
- Object
- Cipherpipe::ExternalSource
- Defined in:
- lib/cipherpipe/external_source.rb
Constant Summary collapse
- UnknownProviderError =
Class.new Cipherpipe::Error
Instance Attribute Summary collapse
-
#destination ⇒ Object
readonly
Returns the value of attribute destination.
-
#ec2_role ⇒ Object
readonly
Returns the value of attribute ec2_role.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
-
#primary ⇒ Object
readonly
Returns the value of attribute primary.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
- #download ⇒ Object
-
#initialize(options = {}) ⇒ ExternalSource
constructor
A new instance of ExternalSource.
- #primary? ⇒ Boolean
- #upload(variables) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ ExternalSource
Returns a new instance of ExternalSource.
6 7 8 9 10 11 12 |
# File 'lib/cipherpipe/external_source.rb', line 6 def initialize( = {}) @type = .delete "type" @destination = .delete "destination" @primary = .delete "primary" @ec2_role = .delete "ec2_role" @options = end |
Instance Attribute Details
#destination ⇒ Object (readonly)
Returns the value of attribute destination.
4 5 6 |
# File 'lib/cipherpipe/external_source.rb', line 4 def destination @destination end |
#ec2_role ⇒ Object (readonly)
Returns the value of attribute ec2_role.
4 5 6 |
# File 'lib/cipherpipe/external_source.rb', line 4 def ec2_role @ec2_role end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
4 5 6 |
# File 'lib/cipherpipe/external_source.rb', line 4 def @options end |
#primary ⇒ Object (readonly)
Returns the value of attribute primary.
4 5 6 |
# File 'lib/cipherpipe/external_source.rb', line 4 def primary @primary end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
4 5 6 |
# File 'lib/cipherpipe/external_source.rb', line 4 def type @type end |
Instance Method Details
#download ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/cipherpipe/external_source.rb', line 14 def download if provider.available? provider.download self else puts "#{type} is not available, download is being skipped." end end |
#primary? ⇒ Boolean
22 23 24 |
# File 'lib/cipherpipe/external_source.rb', line 22 def primary? primary end |
#upload(variables) ⇒ Object
26 27 28 29 30 31 32 |
# File 'lib/cipherpipe/external_source.rb', line 26 def upload(variables) if provider.available? provider.upload self, variables else puts "#{type} is not available, upload is being skipped." end end |