Class: BPL::Derivatives::DatastreamDecorator
- Inherits:
-
InputObjectDecorator
- Object
- SimpleDelegator
- InputObjectDecorator
- BPL::Derivatives::DatastreamDecorator
- Defined in:
- lib/bpl/derivatives/datastream_decorator.rb
Instance Attribute Summary collapse
-
#source_datastream ⇒ Object
Returns the value of attribute source_datastream.
Attributes inherited from InputObjectDecorator
Instance Method Summary collapse
- #content ⇒ Object
- #filename_for_characterization ⇒ Object
- #has_content? ⇒ Boolean
-
#initialize(object, source_datastream_name) ⇒ DatastreamDecorator
constructor
A new instance of DatastreamDecorator.
Constructor Details
#initialize(object, source_datastream_name) ⇒ DatastreamDecorator
Returns a new instance of DatastreamDecorator.
5 6 7 8 |
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 5 def initialize(object, source_datastream_name) super(object) self.source_datastream = object.send(source_datastream_name) end |
Instance Attribute Details
#source_datastream ⇒ Object
Returns the value of attribute source_datastream.
4 5 6 |
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 4 def source_datastream @source_datastream end |
Instance Method Details
#content ⇒ Object
10 11 12 |
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 10 def content self.source_datastream.content end |
#filename_for_characterization ⇒ Object
18 19 20 21 |
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 18 def filename_for_characterization return source_datastream.filename_for_characterization if source_datastream.respond_to?(:filename_for_characterization) self.default_filename_for_charaterization end |
#has_content? ⇒ Boolean
14 15 16 |
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 14 def has_content? self.source_datastream.has_content? end |