Class: Wassup::PaneBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/wassup/pane_builder.rb

Defined Under Namespace

Classes: ContentBuilder

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializePaneBuilder

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_levelObject

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_blockObject

Returns the value of attribute content_block.



25
26
27
# File 'lib/wassup/pane_builder.rb', line 25

def content_block
  @content_block
end

#descriptionObject

Returns the value of attribute description.



18
19
20
# File 'lib/wassup/pane_builder.rb', line 18

def description
  @description
end

#heightObject

Returns the value of attribute height.



10
11
12
# File 'lib/wassup/pane_builder.rb', line 10

def height
  @height
end

#highlightObject

Returns the value of attribute highlight.



15
16
17
# File 'lib/wassup/pane_builder.rb', line 15

def highlight
  @highlight
end

#intervalObject

Returns the value of attribute interval.



24
25
26
# File 'lib/wassup/pane_builder.rb', line 24

def interval
  @interval
end

#leftObject

Returns the value of attribute left.



13
14
15
# File 'lib/wassup/pane_builder.rb', line 13

def left
  @left
end

#selection_blocksObject

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_descriptionObject

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_refreshObject

Returns the value of attribute show_refresh.



22
23
24
# File 'lib/wassup/pane_builder.rb', line 22

def show_refresh
  @show_refresh
end

#titleObject

Returns the value of attribute title.



17
18
19
# File 'lib/wassup/pane_builder.rb', line 17

def title
  @title
end

#topObject

Returns the value of attribute top.



12
13
14
# File 'lib/wassup/pane_builder.rb', line 12

def top
  @top
end

#typeObject

Returns the value of attribute type.



29
30
31
# File 'lib/wassup/pane_builder.rb', line 29

def type
  @type
end

#widthObject

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