Class: Twb::DocDashboardImageVert

Inherits:
DocDashboard show all
Defined in:
lib/twb/docdashboardimagevert.rb

Constant Summary collapse

@@dashdoc =
"      <dashdoc>\n        <dashboard name='Dashboard Automatic Vert with Image'>\n          <style>\n          </style>\n          <zones>\n            <zone h='100000' w='100000'\n                  x='0'      y='0'\n                  type='layout-flow'\n                  param='vert' \n                  id='7' \n                  >\n              <zone h='100000' w='100000'\n                    x='0'      y='0'\n                    type='title'\n                    id='6' \n                    >\n              </zone>\n              <zone h='93157' w='100000'\n                    x='0'     y='6221'\n                    type='bitmap' \n                    is-centered='0'\n                    is-scaled='1'\n                    param='{fully qualified image file name here}' \n                    id='8'\n                    >\n              </zone>\n            </zone>\n          </zones>\n        </dashboard>\n        <window auto-hidden='0' class='dashboard' maximized='1' name='Dashboard Automatic with Image'>\n          <active id='8' />\n          <zones>\n            <zone is-centered='0' is-scaled='1' name='' type='bitmap' />\n          </zones>\n        </window>\n      </dashdoc>\n"

Instance Attribute Summary collapse

Attributes inherited from DocDashboard

#dashnode, #title, #type, #winnode

Instance Method Summary collapse

Methods inherited from DocDashboard

#size=, #to_s

Constructor Details

#initializeDocDashboardImageVert

Returns a new instance of DocDashboardImageVert.



63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# File 'lib/twb/docdashboardimagevert.rb', line 63

def initialize
  @oneImageDash = Nokogiri::XML::Document.parse @@dashdoc 
  # notes:

  #  - adding a size element to the <dashboard element will change it from automatic, e.g.

  #

  #    <dashboard name='One Column Web Page Laptop (800w 600h)'>

  #    <style>

  #    </style>

  #    <size maxheight='600' maxwidth='800' minheight='600' minwidth='800' />

  #

  #  - the 'name' sttributes for the window and dashboard must match

  @type = 'columnar Image'
  @dashnode = @oneImageDash.at_xpath('//dashboard')
  @winnode  = @oneImageDash.at_xpath('//window')
end

Instance Attribute Details

#imageObject

Returns the value of attribute image.



22
23
24
# File 'lib/twb/docdashboardimagevert.rb', line 22

def image
  @image
end

Instance Method Details

#title=(title) ⇒ Object



79
80
81
82
83
# File 'lib/twb/docdashboardimagevert.rb', line 79

def title=(title)
  @title = title
  @dashnode['name'] = title
  @winnode['name']  = title
end