module ImageParadise::Svg

Constants

N
#

N

#

Public Class Methods

add(i = '') click to toggle source
#

Svg.add

Simply append onto @_.

#
# File lib/image_paradise/svg/svg.rb, line 57
def self.add(i = '')
  i = i.to_s.dup
  @_ << i
end
add_linebreak() click to toggle source
#

Svg.add

#
# File lib/image_paradise/svg/svg.rb, line 98
def self.add_linebreak
  add "<br>#{N}"
end
chart_directory() click to toggle source
#

Svg.chart_directory

Give us the path towards the svg_-charts subdirectory.

#
# File lib/image_paradise/svg/svg.rb, line 76
def self.chart_directory
  ::ImageParadise.project_base_dir?+'charts/'
end
circle( a = '100', b = 'red', c = '3', r = '40' ) click to toggle source
#

Svg.circle

Always sync to the above method.

Usage example:

Svg.circle(150,:blue,5,20)
#
# File lib/image_paradise/svg/circle.rb, line 97
def self.circle(
    a = '100',
    b = 'red',
    c = '3',
    r = '40'
  )
  Svg::Circle.create(a,b,c,r)
end
close_svg() click to toggle source
#

Svg.close_svg

Simply close the <svg> tag here

#
# File lib/image_paradise/svg/svg.rb, line 67
def self.close_svg
  return '</svg>'+N
end
load_chart_module() click to toggle source
#

Svg.load_chart_module

This method will load the individual .rb files from the chart/ subdirectory. Currently this is not in use though - perhaps one day when I get to use the chart-svg subsection.

#
# File lib/image_paradise/svg/svg.rb, line 87
def self.load_chart_module
  these_files = Svg.chart_directory+'*.rb'
  Dir[these_files].each {|file|
    file = 'image_paradise/svg/charts/'+File.basename(file)
    require file # And require it.
  }
end
rectangle( a = Svg::Rectangle::DEFAULT_WIDTH, b = Svg::Rectangle::DEFAULT_HEIGHT, c = Svg::Rectangle::DEFAULT_FILL_COLOUR, d = '3', &block ) click to toggle source
#

ImageParadise::Svg.rectangle

Always sync to the above method.

Usage examples:

Svg.rectangle(150,:blue,5,20)
#
# File lib/image_paradise/svg/rectangle.rb, line 144
def self.rectangle(
    a = Svg::Rectangle::DEFAULT_WIDTH,
    b = Svg::Rectangle::DEFAULT_HEIGHT,
    c = Svg::Rectangle::DEFAULT_FILL_COLOUR,
    d = '3',
    &block
  )
  Svg::Rectangle.create(a,b,c,d) { block }
end
reset() click to toggle source
#

Svg.reset

#
# File lib/image_paradise/svg/svg.rb, line 34
def self.reset
  @_ = ''
end
string?() click to toggle source
#

Svg.string?

#
# File lib/image_paradise/svg/svg.rb, line 48
def self.string?
  @_
end
strip(i) click to toggle source
#

Svg.strip

#
# File lib/image_paradise/svg/svg.rb, line 41
def self.strip(i)
  return i.squeeze(' ')
end