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(skill, h) ⇒ Object
Constructor Details
#initialize(skills = {}, debug: false, rsc: nil, whitelist: {users: nil, devices: nil}) ⇒ AlexaSkillResponseCollection
Returns a new instance of AlexaSkillResponseCollection.
152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
# File 'lib/alexa_skillresponse.rb', line 152 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(skill, h) ⇒ Object
167 168 169 170 171 172 173 |
# File 'lib/alexa_skillresponse.rb', line 167 def run(skill, h) puts 'skill: ' + skill.inspect if @debug puts '@skills: ' + @skills.inspect if @debug @skills[skill].run h end |