Class: Daj

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-daj/daj.rb

Overview

Main class

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#kindObject

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