Class: TextRecord::FileAttribute
- Defined in:
- lib/text_record/attribute.rb
Instance Attribute Summary
Attributes inherited from Attribute
Instance Method Summary collapse
Methods inherited from Attribute
Constructor Details
This class inherits a constructor from TextRecord::Attribute
Instance Method Details
#parse(obj) ⇒ Object
22 23 24 25 |
# File 'lib/text_record/attribute.rb', line 22 def parse(obj) file_contents = IO.read("#{obj.directory}/#{[:from]}") obj.instance_variable_set("@#{name.to_s.underscore}".to_sym, file_contents) end |