Class: AlexaGenerator::Slot

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

Defined Under Namespace

Modules: SlotType Classes: Builder

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, type, bindings) ⇒ Slot

Returns a new instance of Slot.



43
44
45
46
47
# File 'lib/alexa_generator/slot.rb', line 43

def initialize(name, type, bindings)
  @name = name.to_sym
  @type = type
  @bindings = bindings
end

Instance Attribute Details

#bindingsObject (readonly)

Returns the value of attribute bindings.



41
42
43
# File 'lib/alexa_generator/slot.rb', line 41

def bindings
  @bindings
end

#nameObject (readonly)

Returns the value of attribute name.



41
42
43
# File 'lib/alexa_generator/slot.rb', line 41

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



41
42
43
# File 'lib/alexa_generator/slot.rb', line 41

def type
  @type
end

Class Method Details

.build(name, type, &block) ⇒ Object



49
50
51
52
53
# File 'lib/alexa_generator/slot.rb', line 49

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