Class: Konami::Fo

Inherits:
PayDirt::Base
  • Object
show all
Defined in:
lib/konami/fo.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Fo

Returns a new instance of Fo.



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/konami/fo.rb', line 8

def initialize(options = {})
  options = {
    konamio: Konamio::Sequence::Requisition,
    konamio_params: {
      prompt: "Enter the Konami code!",
      confirmation: false
    },
    foaas:   Foaas::FO,
    foaas_params: {
      name: "You",
      from: "Me",
    }
  }.merge(options)

  load_options(options)
end

Instance Method Details

#execute!Object



25
26
27
28
29
30
31
# File 'lib/konami/fo.rb', line 25

def execute!
  @konamio.new(@konamio_params).execute! {
    @response = @foaas.new(@foaas_params).execute!
    puts "#{@response.data["message"]} #{@response.data["subtitle"]}"
  }
  return result(true, @response)
end