Class: Saucy::ThroughAlias

Inherits:
Object
  • Object
show all
Defined in:
lib/saucy/routing_extensions.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(route, through) ⇒ ThroughAlias

Returns a new instance of ThroughAlias.



25
26
27
28
# File 'lib/saucy/routing_extensions.rb', line 25

def initialize(route, through)
  @route = route
  @through = through
end

Instance Attribute Details

#routeObject (readonly)

Returns the value of attribute route.



23
24
25
# File 'lib/saucy/routing_extensions.rb', line 23

def route
  @route
end

#throughObject (readonly)

Returns the value of attribute through.



23
24
25
# File 'lib/saucy/routing_extensions.rb', line 23

def through
  @through
end

Instance Method Details

#to_method(kind) ⇒ Object



30
31
32
33
34
35
36
# File 'lib/saucy/routing_extensions.rb', line 30

def to_method(kind)
  return <<-RUBY
    def #{alias_name}_#{kind}(#{arguments.last}, options = {})
      #{route_name}_#{kind}(#{arguments.join(', ')}, options)
    end
  RUBY
end