Class: Adapt::RoutingBuilder::Intent

Inherits:
Object
  • Object
show all
Defined in:
lib/adapt/routing_builder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Intent

Returns a new instance of Intent.



9
10
11
12
13
# File 'lib/adapt/routing_builder.rb', line 9

def initialize(name)
  @name = name

  @entities = []
end

Instance Attribute Details

#entitiesObject (readonly)

Returns the value of attribute entities.



7
8
9
# File 'lib/adapt/routing_builder.rb', line 7

def entities
  @entities
end

#nameObject (readonly)

Returns the value of attribute name.



7
8
9
# File 'lib/adapt/routing_builder.rb', line 7

def name
  @name
end

Instance Method Details

#optional(entity) ⇒ Object



21
22
23
24
25
# File 'lib/adapt/routing_builder.rb', line 21

def optional(entity)
  @entities << {entity => :optional}

  return self
end

#required(entity) ⇒ Object



15
16
17
18
19
# File 'lib/adapt/routing_builder.rb', line 15

def required(entity)
  @entities << {entity => :required}

  return self
end