Class: Barker::Joker

Inherits:
Object
  • Object
show all
Defined in:
lib/barker/joker.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#idObject (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_idObject



9
10
11
# File 'lib/barker/joker.rb', line 9

def joker_id
  @id
end