Class: DYI::Formatter::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/dyi/formatter/base.rb

Overview

Since:

  • 0.0.0

Direct Known Subclasses

EmfFormatter, EpsFormatter, XmlFormatter

Instance Method Summary collapse

Constructor Details

#initialize(canvas) ⇒ Base

Returns a new instance of Base.

Since:

  • 0.0.0



30
31
32
# File 'lib/dyi/formatter/base.rb', line 30

def initialize(canvas)
  @canvas = canvas
end

Instance Method Details

#puts(io = $>) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



34
35
36
# File 'lib/dyi/formatter/base.rb', line 34

def puts(io=$>)
  raise NotImplementedError
end

#save(file_name, options = {}) ⇒ Object

Since:

  • 0.0.0



43
44
45
# File 'lib/dyi/formatter/base.rb', line 43

def save(file_name, options={})
  open(file_name, "w") {|io| puts(io)}
end

#stringObject

Since:

  • 0.0.0



38
39
40
41
# File 'lib/dyi/formatter/base.rb', line 38

def string
  puts(sio = StringIO.new)
  sio.string
end

#write_canvas(canvas, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



47
48
49
# File 'lib/dyi/formatter/base.rb', line 47

def write_canvas(canvas, io)
  raise NotImplementedError
end

#write_circle(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



55
56
57
# File 'lib/dyi/formatter/base.rb', line 55

def write_circle(shape, io)
  raise NotImplementedError
end

#write_ellipse(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



59
60
61
# File 'lib/dyi/formatter/base.rb', line 59

def write_ellipse(shape, io)
  raise NotImplementedError
end

#write_group(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



87
88
89
# File 'lib/dyi/formatter/base.rb', line 87

def write_group(shape, io)
  raise NotImplementedError
end

#write_image(shape, io) ⇒ Object

Since:

  • 1.0.0



80
81
# File 'lib/dyi/formatter/base.rb', line 80

def write_image(shape, io)
end

#write_line(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



63
64
65
# File 'lib/dyi/formatter/base.rb', line 63

def write_line(shape, io)
  raise NotImplementedError
end

#write_path(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



75
76
77
# File 'lib/dyi/formatter/base.rb', line 75

def write_path(shape, io)
  raise NotImplementedError
end

#write_polygon(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



71
72
73
# File 'lib/dyi/formatter/base.rb', line 71

def write_polygon(shape, io)
  raise NotImplementedError
end

#write_polyline(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



67
68
69
# File 'lib/dyi/formatter/base.rb', line 67

def write_polyline(shape, io)
  raise NotImplementedError
end

#write_rectangle(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



51
52
53
# File 'lib/dyi/formatter/base.rb', line 51

def write_rectangle(shape, io)
  raise NotImplementedError
end

#write_text(shape, io) ⇒ Object

Raises:

  • (NotImplementedError)

Since:

  • 0.0.0



83
84
85
# File 'lib/dyi/formatter/base.rb', line 83

def write_text(shape, io)
  raise NotImplementedError
end