Class: AlexaSkillResponseCollection
- Inherits:
-
Object
- Object
- AlexaSkillResponseCollection
- Defined in:
- lib/alexa_skillresponse.rb
Instance Method Summary collapse
-
#initialize(skills = {}, debug: false, rsc: nil, whitelist: {users: nil, devices: nil}) ⇒ AlexaSkillResponseCollection
constructor
A new instance of AlexaSkillResponseCollection.
- #run(h) ⇒ Object
Constructor Details
#initialize(skills = {}, debug: false, rsc: nil, whitelist: {users: nil, devices: nil}) ⇒ AlexaSkillResponseCollection
147 148 149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/alexa_skillresponse.rb', line 147 def initialize(skills={}, debug: false, rsc: nil, whitelist: {users: nil, devices: nil}) @debug = debug @skills = skills.inject({}) do |r, x| package_name, rsf_package = x asr = AlexaSkillResponse.new(rsf_package, debug: debug, rsc: rsc, whitelist: whitelist) r.merge(package_name => asr) end end |
Instance Method Details
#run(h) ⇒ Object
162 163 164 165 166 167 |
# File 'lib/alexa_skillresponse.rb', line 162 def run(h) puts '@skills: ' + @skills.inspect if @debug @skills[h[:skill]].run h end |