Class: Ralyxa::RegisterIntents
- Inherits:
-
Object
- Object
- Ralyxa::RegisterIntents
- Defined in:
- lib/ralyxa/register_intents.rb
Constant Summary collapse
- DEFAULT_INTENTS_DIRECTORY =
'./intents'.freeze
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(intents_directory, alexa_skill_class) ⇒ RegisterIntents
constructor
A new instance of RegisterIntents.
- #run ⇒ Object
Constructor Details
#initialize(intents_directory, alexa_skill_class) ⇒ RegisterIntents
Returns a new instance of RegisterIntents.
7 8 9 10 |
# File 'lib/ralyxa/register_intents.rb', line 7 def initialize(intents_directory, alexa_skill_class) @intents_directory = intents_directory @alexa_skill_class = alexa_skill_class end |
Class Method Details
.run(intents_directory = DEFAULT_INTENTS_DIRECTORY, alexa_skill_class = Ralyxa::Skill) ⇒ Object
12 13 14 |
# File 'lib/ralyxa/register_intents.rb', line 12 def self.run(intents_directory = DEFAULT_INTENTS_DIRECTORY, alexa_skill_class = Ralyxa::Skill) new(intents_directory, alexa_skill_class).run end |
Instance Method Details
#run ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/ralyxa/register_intents.rb', line 16 def run warn NO_INTENT_DECLARATIONS_FOUND if intent_declarations.empty? intent_declarations.each do |intent_declaration| alexa_skill_class.class_eval intent_declaration end end |