Class: Daj
- Inherits:
-
Object
- Object
- Daj
- Defined in:
- lib/ruby-daj/daj.rb
Overview
Main class
Instance Attribute Summary collapse
-
#kind ⇒ Object
Returns the value of attribute kind.
Instance Method Summary collapse
-
#<(filename) ⇒ Object
Less than operator as read file.
- #>(filename) ⇒ Object
-
#initialize(data = nil) ⇒ Daj
constructor
Constructor.
Constructor Details
#initialize(data = nil) ⇒ Daj
Constructor
7 8 9 |
# File 'lib/ruby-daj/daj.rb', line 7 def initialize(data = nil) @data = data end |
Instance Attribute Details
#kind ⇒ Object
Returns the value of attribute kind.
4 5 6 |
# File 'lib/ruby-daj/daj.rb', line 4 def kind @kind end |
Instance Method Details
#<(filename) ⇒ Object
Less than operator as read file
12 13 14 15 |
# File 'lib/ruby-daj/daj.rb', line 12 def <(filename) ext = kind || extension(filename) Reader.new.read(ext, filename) end |
#>(filename) ⇒ Object
17 18 19 20 |
# File 'lib/ruby-daj/daj.rb', line 17 def >(filename) ext = kind || extension(filename) Writer.new(@data).write(ext, filename) end |