Class: AlexaGenerator::Intent

Inherits:
Object
  • Object
show all
Defined in:
lib/alexa_generator/intent.rb

Defined Under Namespace

Modules: AmazonIntentType Classes: Builder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, slots) ⇒ Intent

Returns a new instance of Intent.



70
71
72
73
# File 'lib/alexa_generator/intent.rb', line 70

def initialize(name, slots)
  @name = name
  @slots = slots
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



31
32
33
# File 'lib/alexa_generator/intent.rb', line 31

def name
  @name
end

#slotsObject (readonly)

Returns the value of attribute slots.



31
32
33
# File 'lib/alexa_generator/intent.rb', line 31

def slots
  @slots
end

Class Method Details

.build(name, &block) ⇒ Object



79
80
81
82
83
# File 'lib/alexa_generator/intent.rb', line 79

def self.build(name, &block)
  builder = Builder.new(name)
  block.call(builder) if block
  builder
end

Instance Method Details

#amazon_intent?Boolean

Returns:

  • (Boolean)


75
76
77
# File 'lib/alexa_generator/intent.rb', line 75

def amazon_intent?
  AmazonIntentType.amazon_intent?(@name)
end