Class: Cloudrider::Protofile
- Inherits:
-
Object
- Object
- Cloudrider::Protofile
- Defined in:
- lib/cloudrider/protofile.rb
Defined Under Namespace
Classes: OnlyBeCalledWhenNoType
Instance Attribute Summary collapse
-
#file_name ⇒ Object
Returns the value of attribute file_name.
-
#folder ⇒ Object
Returns the value of attribute folder.
-
#renderer ⇒ Object
Returns the value of attribute renderer.
-
#source ⇒ Object
Returns the value of attribute source.
-
#target ⇒ Object
Returns the value of attribute target.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #content ⇒ Object
- #full_name ⇒ Object
-
#initialize(opts = {}) ⇒ Protofile
constructor
A new instance of Protofile.
Constructor Details
#initialize(opts = {}) ⇒ Protofile
Returns a new instance of Protofile.
4 5 6 7 8 |
# File 'lib/cloudrider/protofile.rb', line 4 def initialize(opts={}) @type = opts[:type] @source = opts[:source] @target = opts[:target] end |
Instance Attribute Details
#file_name ⇒ Object
Returns the value of attribute file_name.
3 4 5 |
# File 'lib/cloudrider/protofile.rb', line 3 def file_name @file_name end |
#folder ⇒ Object
Returns the value of attribute folder.
3 4 5 |
# File 'lib/cloudrider/protofile.rb', line 3 def folder @folder end |
#renderer ⇒ Object
Returns the value of attribute renderer.
3 4 5 |
# File 'lib/cloudrider/protofile.rb', line 3 def renderer @renderer end |
#source ⇒ Object
Returns the value of attribute source.
3 4 5 |
# File 'lib/cloudrider/protofile.rb', line 3 def source @source end |
#target ⇒ Object
Returns the value of attribute target.
3 4 5 |
# File 'lib/cloudrider/protofile.rb', line 3 def target @target end |
#type ⇒ Object
Returns the value of attribute type.
3 4 5 |
# File 'lib/cloudrider/protofile.rb', line 3 def type @type end |
Instance Method Details
#content ⇒ Object
13 14 15 |
# File 'lib/cloudrider/protofile.rb', line 13 def content renderer.call end |
#full_name ⇒ Object
9 10 11 12 |
# File 'lib/cloudrider/protofile.rb', line 9 def full_name raise OnlyBeCalledWhenNoType, _debug_string if ["copy_file", "directory"].include? @type.to_s File.join *[folder, file_name].reject(&:blank?) end |