Class: Barker::Joker
- Inherits:
-
Object
- Object
- Barker::Joker
- Defined in:
- lib/barker/joker.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #call(candidate_question) ⇒ Object
-
#initialize(id) ⇒ Joker
constructor
A new instance of Joker.
- #joker_id ⇒ Object
Constructor Details
#initialize(id) ⇒ Joker
Returns a new instance of Joker.
5 6 7 |
# File 'lib/barker/joker.rb', line 5 def initialize(id) @id = id end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
3 4 5 |
# File 'lib/barker/joker.rb', line 3 def id @id end |
Instance Method Details
#call(candidate_question) ⇒ Object
13 14 15 |
# File 'lib/barker/joker.rb', line 13 def call(candidate_question) "Barker::Jokers::#{id.to_s.classify}".constantize.call(candidate_question) end |
#joker_id ⇒ Object
9 10 11 |
# File 'lib/barker/joker.rb', line 9 def joker_id @id end |