Class: Wassup::PaneBuilder
- Inherits:
-
Object
- Object
- Wassup::PaneBuilder
- Defined in:
- lib/wassup/pane_builder.rb
Defined Under Namespace
Classes: ContentBuilder
Instance Attribute Summary collapse
-
#alert_level ⇒ Object
Returns the value of attribute alert_level.
-
#content_block ⇒ Object
Returns the value of attribute content_block.
-
#description ⇒ Object
Returns the value of attribute description.
-
#height ⇒ Object
Returns the value of attribute height.
-
#highlight ⇒ Object
Returns the value of attribute highlight.
-
#interval ⇒ Object
Returns the value of attribute interval.
-
#left ⇒ Object
Returns the value of attribute left.
-
#selection_blocks ⇒ Object
Returns the value of attribute selection_blocks.
-
#selection_blocks_description ⇒ Object
Returns the value of attribute selection_blocks_description.
-
#show_refresh ⇒ Object
Returns the value of attribute show_refresh.
-
#title ⇒ Object
Returns the value of attribute title.
-
#top ⇒ Object
Returns the value of attribute top.
-
#type ⇒ Object
Returns the value of attribute type.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #content(&block) ⇒ Object
-
#initialize ⇒ PaneBuilder
constructor
A new instance of PaneBuilder.
- #selection(input = 10, description = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ PaneBuilder
Returns a new instance of PaneBuilder.
75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/wassup/pane_builder.rb', line 75 def initialize @height = 1 @weight = 1 @top = 0 @left = 0 @highlight = false @interval = 60 * 5 @selection_blocks = {} @selection_blocks_description = {} end |
Instance Attribute Details
#alert_level ⇒ Object
Returns the value of attribute alert_level.
20 21 22 |
# File 'lib/wassup/pane_builder.rb', line 20 def alert_level @alert_level end |
#content_block ⇒ Object
Returns the value of attribute content_block.
25 26 27 |
# File 'lib/wassup/pane_builder.rb', line 25 def content_block @content_block end |
#description ⇒ Object
Returns the value of attribute description.
18 19 20 |
# File 'lib/wassup/pane_builder.rb', line 18 def description @description end |
#height ⇒ Object
Returns the value of attribute height.
10 11 12 |
# File 'lib/wassup/pane_builder.rb', line 10 def height @height end |
#highlight ⇒ Object
Returns the value of attribute highlight.
15 16 17 |
# File 'lib/wassup/pane_builder.rb', line 15 def highlight @highlight end |
#interval ⇒ Object
Returns the value of attribute interval.
24 25 26 |
# File 'lib/wassup/pane_builder.rb', line 24 def interval @interval end |
#left ⇒ Object
Returns the value of attribute left.
13 14 15 |
# File 'lib/wassup/pane_builder.rb', line 13 def left @left end |
#selection_blocks ⇒ Object
Returns the value of attribute selection_blocks.
26 27 28 |
# File 'lib/wassup/pane_builder.rb', line 26 def selection_blocks @selection_blocks end |
#selection_blocks_description ⇒ Object
Returns the value of attribute selection_blocks_description.
27 28 29 |
# File 'lib/wassup/pane_builder.rb', line 27 def selection_blocks_description @selection_blocks_description end |
#show_refresh ⇒ Object
Returns the value of attribute show_refresh.
22 23 24 |
# File 'lib/wassup/pane_builder.rb', line 22 def show_refresh @show_refresh end |
#title ⇒ Object
Returns the value of attribute title.
17 18 19 |
# File 'lib/wassup/pane_builder.rb', line 17 def title @title end |
#top ⇒ Object
Returns the value of attribute top.
12 13 14 |
# File 'lib/wassup/pane_builder.rb', line 12 def top @top end |
#type ⇒ Object
Returns the value of attribute type.
29 30 31 |
# File 'lib/wassup/pane_builder.rb', line 29 def type @type end |
#width ⇒ Object
Returns the value of attribute width.
11 12 13 |
# File 'lib/wassup/pane_builder.rb', line 11 def width @width end |
Instance Method Details
#content(&block) ⇒ Object
92 93 94 |
# File 'lib/wassup/pane_builder.rb', line 92 def content(&block) self.content_block = block end |
#selection(input = 10, description = nil, &block) ⇒ Object
95 96 97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/wassup/pane_builder.rb', line 95 def selection(input=10, description=nil, &block) if input.to_s.downcase == "enter" input = 10 end description_input = input if input.to_s == "10" description_input = "enter" end self.selection_blocks[input] = block self.selection_blocks_description[description_input] = description end |