Class: BPL::Derivatives::DatastreamDecorator

Inherits:
InputObjectDecorator show all
Defined in:
lib/bpl/derivatives/datastream_decorator.rb

Instance Attribute Summary collapse

Attributes inherited from InputObjectDecorator

#source_path

Instance Method Summary collapse

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_datastreamObject

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

#contentObject



10
11
12
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 10

def content
  self.source_datastream.content
end

#filename_for_characterizationObject



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

Returns:

  • (Boolean)


14
15
16
# File 'lib/bpl/derivatives/datastream_decorator.rb', line 14

def has_content?
  self.source_datastream.has_content?
end