Class: FortuneTeller::Panel

Inherits:
Object
  • Object
show all
Defined in:
lib/fortune_teller/panel.rb

Direct Known Subclasses

Reveal

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(label, options = {}) ⇒ Panel

Returns a new instance of Panel.



7
8
9
10
11
# File 'lib/fortune_teller/panel.rb', line 7

def initialize(label, options = {} )
  @label = label
  @ui = options[:ui]
  @reveal = options[:reveal] || NilPanel.new(@ui)
end

Instance Attribute Details

#labelObject (readonly) Also known as: to_s

Returns the value of attribute label.



4
5
6
# File 'lib/fortune_teller/panel.rb', line 4

def label
  @label
end

#revealObject

Returns the value of attribute reveal.



5
6
7
# File 'lib/fortune_teller/panel.rb', line 5

def reveal
  @reveal
end

#uiObject

Returns the value of attribute ui.



6
7
8
# File 'lib/fortune_teller/panel.rb', line 6

def ui
  @ui
end

Instance Method Details

#pickObject



18
19
20
21
# File 'lib/fortune_teller/panel.rb', line 18

def pick
  ui.interstitial( "Flick, flick, flick, flick..." )
  reveal.choose
end

#present?Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/fortune_teller/panel.rb', line 14

def present?
  true
end