Class: Twb::Dashboard
- Inherits:
-
Object
- Object
- Twb::Dashboard
- Defined in:
- lib/twb/dashboard.rb
Constant Summary collapse
- @@hasher =
Digest::SHA256.new
Instance Attribute Summary collapse
-
#autosize ⇒ Object
readonly
Returns the value of attribute autosize.
-
#dimensions ⇒ Object
readonly
Returns the value of attribute dimensions.
-
#maxheight ⇒ Object
readonly
Returns the value of attribute maxheight.
-
#maxwidth ⇒ Object
readonly
Returns the value of attribute maxwidth.
-
#minheight ⇒ Object
readonly
Returns the value of attribute minheight.
-
#minwidth ⇒ Object
readonly
Returns the value of attribute minwidth.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#node ⇒ Object
readonly
Returns the value of attribute node.
-
#rangesize ⇒ Object
readonly
Returns the value of attribute rangesize.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#worksheets ⇒ Object
readonly
Returns the value of attribute worksheets.
Instance Method Summary collapse
-
#initialize(dashboardNode) ⇒ Dashboard
constructor
A new instance of Dashboard.
- #loadSheets ⇒ Object
- #loadSize(size) ⇒ Object
Constructor Details
#initialize(dashboardNode) ⇒ Dashboard
Returns a new instance of Dashboard.
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/twb/dashboard.rb', line 27 def initialize dashboardNode "initialize Dashboard" @node = dashboardNode @name = @node.attr('name') @size = @node.xpath('./size') @autosize = @size.empty? loadSize @size unless @autosize loadSheets return self end |
Instance Attribute Details
#autosize ⇒ Object (readonly)
Returns the value of attribute autosize.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def autosize @autosize end |
#dimensions ⇒ Object (readonly)
Returns the value of attribute dimensions.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def dimensions @dimensions end |
#maxheight ⇒ Object (readonly)
Returns the value of attribute maxheight.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def maxheight @maxheight end |
#maxwidth ⇒ Object (readonly)
Returns the value of attribute maxwidth.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def maxwidth @maxwidth end |
#minheight ⇒ Object (readonly)
Returns the value of attribute minheight.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def minheight @minheight end |
#minwidth ⇒ Object (readonly)
Returns the value of attribute minwidth.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def minwidth @minwidth end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def name @name end |
#node ⇒ Object (readonly)
Returns the value of attribute node.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def node @node end |
#rangesize ⇒ Object (readonly)
Returns the value of attribute rangesize.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def rangesize @rangesize end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def size @size end |
#worksheets ⇒ Object (readonly)
Returns the value of attribute worksheets.
25 26 27 |
# File 'lib/twb/dashboard.rb', line 25 def worksheets @worksheets end |
Instance Method Details
#loadSheets ⇒ Object
38 39 40 41 42 43 44 45 |
# File 'lib/twb/dashboard.rb', line 38 def loadSheets @sheets = {} dsheets = @node.xpath('.//zone[@name]').to_a dsheets.each do |sheetNode| sheet = Twb::Worksheet.new sheetNode @sheets[sheet.name] = sheet end end |
#loadSize(size) ⇒ Object
51 52 53 54 55 56 57 58 |
# File 'lib/twb/dashboard.rb', line 51 def loadSize size @maxheight = size.attr('maxheight') @maxwidth = size.attr('maxwidth') @minheight = size.attr('minheight') @minwidth = size.attr('minwidth') @rangesize = size.attr('rangesize') @dimensions = @minwidth.to_s + ':' + @minheight.to_s + ':' +@maxwidth.to_s + ':' +@maxheight.to_s end |