Class: ChupaText::TextData
Instance Attribute Summary
Attributes inherited from Data
#attributes, #body, #path, #size, #source, #uri
Instance Method Summary collapse
-
#initialize(text, options = {}) ⇒ TextData
constructor
A new instance of TextData.
Methods inherited from Data
#[], #[]=, #extension, #initialize_copy, #merge!, #mime_type, #mime_type=, #open, #text?, #text_plain?
Constructor Details
#initialize(text, options = {}) ⇒ TextData
Returns a new instance of TextData.
19 20 21 22 23 24 |
# File 'lib/chupa-text/text-data.rb', line 19 def initialize(text, ={}) super() self.mime_type = "text/plain" self.body = text self.size = text.bytesize end |