Class: GRI::Writer

Inherits:
Object show all
Defined in:
lib/gri/writer.rb

Constant Summary collapse

TYPES =
{}

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Writer

Returns a new instance of Writer.



22
23
# File 'lib/gri/writer.rb', line 22

def initialize options={}
end

Instance Attribute Details

#loopObject

Returns the value of attribute loop.



20
21
22
# File 'lib/gri/writer.rb', line 20

def loop
  @loop
end

Class Method Details

.create(wtype, options) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/gri/writer.rb', line 7

def self.create wtype, options
  if (klass = TYPES[wtype])
    options.select {|k, v| String === k}.each {|k, v|
      options[k.gsub('-', '_').intern] = v}
    begin
      klass.new options
    rescue
      Log.error "Writer.create error: #{$!}"
      nil
    end
  end
end