Class: Rubillow::Models::Chart

Inherits:
Base
  • Object
show all
Defined in:
lib/rubillow/models/chart.rb

Overview

Base chart class.

Direct Known Subclasses

PropertyChart, RegionChart

Instance Attribute Summary collapse

Attributes inherited from Base

#code, #message, #near_limit, #xml

Instance Method Summary collapse

Methods inherited from Base

#success?

Methods included from XmlParsingHelper

#xpath_if_present

Instance Attribute Details

#heightString

Returns image height.

Returns:

  • (String)

    image height.



6
7
8
# File 'lib/rubillow/models/chart.rb', line 6

def height
  @height
end

#urlString

Returns URL to image.

Returns:

  • (String)

    URL to image.



12
13
14
# File 'lib/rubillow/models/chart.rb', line 12

def url
  @url
end

#widthString

Returns image width.

Returns:

  • (String)

    image width.



9
10
11
# File 'lib/rubillow/models/chart.rb', line 9

def width
  @width
end

Instance Method Details

#to_htmlString

Returns HTML for the chart.

Returns:

  • (String)

    chart HTML.



16
17
18
# File 'lib/rubillow/models/chart.rb', line 16

def to_html
  "<img src='#{@url}' height='#{@height}' width='#{width}' />"
end