Class: ChupaText::VirtualFileData

Inherits:
Data
  • Object
show all
Defined in:
lib/chupa-text/virtual-file-data.rb

Instance Attribute Summary

Attributes inherited from Data

#attributes, #expected_screenshot_size, #need_screenshot, #path, #screenshot, #source, #uri

Instance Method Summary collapse

Methods inherited from Data

#[], #[]=, #extension, #initialize_copy, #merge!, #mime_type, #mime_type=, #need_screenshot?, #text?, #text_plain?

Constructor Details

#initialize(uri, input, options = {}) ⇒ VirtualFileData



19
20
21
22
23
24
# File 'lib/chupa-text/virtual-file-data.rb', line 19

def initialize(uri, input, options={})
  super(options)
  self.uri = uri
  @content = VirtualContent.new(input, path)
  self.path = @content.path
end

Instance Method Details

#bodyObject



26
27
28
# File 'lib/chupa-text/virtual-file-data.rb', line 26

def body
  @content.body
end

#open(&block) ⇒ Object



34
35
36
# File 'lib/chupa-text/virtual-file-data.rb', line 34

def open(&block)
  @content.open(&block)
end

#sizeObject



30
31
32
# File 'lib/chupa-text/virtual-file-data.rb', line 30

def size
  @content.size
end