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.



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/wassup/pane_builder.rb', line 65

def initialize()
  @height = 1
  @weight = 1
  @top = 0
  @left = 0

  @highlight = false
  @interval = 60 * 5 

  @selection_blocks = {}
  @selection_blocks_description = {}
end

Instance Attribute Details

#content_blockObject

Returns the value of attribute content_block.



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

def content_block
  @content_block
end

#descriptionObject

Returns the value of attribute description.



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

def description
  @description
end

#heightObject

Returns the value of attribute height.



4
5
6
# File 'lib/wassup/pane_builder.rb', line 4

def height
  @height
end

#highlightObject

Returns the value of attribute highlight.



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

def highlight
  @highlight
end

#intervalObject

Returns the value of attribute interval.



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

def interval
  @interval
end

#leftObject

Returns the value of attribute left.



7
8
9
# File 'lib/wassup/pane_builder.rb', line 7

def left
  @left
end

#selection_blocksObject

Returns the value of attribute selection_blocks.



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

def selection_blocks
  @selection_blocks
end

#selection_blocks_descriptionObject

Returns the value of attribute selection_blocks_description.



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

def selection_blocks_description
  @selection_blocks_description
end

#show_refreshObject

Returns the value of attribute show_refresh.



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

def show_refresh
  @show_refresh
end

#titleObject

Returns the value of attribute title.



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

def title
  @title
end

#topObject

Returns the value of attribute top.



6
7
8
# File 'lib/wassup/pane_builder.rb', line 6

def top
  @top
end

#widthObject

Returns the value of attribute width.



5
6
7
# File 'lib/wassup/pane_builder.rb', line 5

def width
  @width
end

Instance Method Details

#content(&block) ⇒ Object



78
79
80
# File 'lib/wassup/pane_builder.rb', line 78

def content(&block)
  self.content_block = block
end

#selection(input = 10, description = nil, &block) ⇒ Object



81
82
83
84
85
86
87
88
89
90
91
92
93
# File 'lib/wassup/pane_builder.rb', line 81

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