Class: UU::OS::Attachment::StreamWrapper

Inherits:
Delegator
  • Object
show all
Defined in:
uu_os-0.29.16/lib/uu/os/attachment/stream_wrapper.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (StreamWrapper) initialize(obj, path)

Returns a new instance of StreamWrapper



13
14
15
16
17
18
# File 'uu_os-0.29.16/lib/uu/os/attachment/stream_wrapper.rb', line 13

def initialize(obj, path)
  super obj              # pass obj to Delegator constructor, required
  @delegate_sd_obj = obj # store obj for future use
  @path = path
  @original_filename = File.basename(path)
end

Instance Attribute Details

- (Object) original_filename

Returns the value of attribute original_filename



11
12
13
# File 'uu_os-0.29.16/lib/uu/os/attachment/stream_wrapper.rb', line 11

def original_filename
  @original_filename
end

- (Object) path

Path of the file



9
10
11
# File 'uu_os-0.29.16/lib/uu/os/attachment/stream_wrapper.rb', line 9

def path
  @path
end

Instance Method Details

- (Object) __getobj__



20
21
22
# File 'uu_os-0.29.16/lib/uu/os/attachment/stream_wrapper.rb', line 20

def __getobj__
  @delegate_sd_obj # return object we are delegating to, required
end

- (Object) __setobj__(obj)



24
25
26
27
# File 'uu_os-0.29.16/lib/uu/os/attachment/stream_wrapper.rb', line 24

def __setobj__(obj)
  @delegate_sd_obj = obj # change delegation object,
                         # a feature we're providing
end