Class: Praxis::Route
- Inherits:
-
Object
- Object
- Praxis::Route
- Defined in:
- lib/praxis/route.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#options ⇒ Object
Returns the value of attribute options.
-
#path ⇒ Object
Returns the value of attribute path.
-
#prefixed_path ⇒ Object
Returns the value of attribute prefixed_path.
-
#verb ⇒ Object
Returns the value of attribute verb.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #describe ⇒ Object
-
#initialize(verb, path, version = 'n/a', name: nil, prefixed_path: nil, **options) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(verb, path, version = 'n/a', name: nil, prefixed_path: nil, **options) ⇒ Route
Returns a new instance of Route.
6 7 8 9 10 11 12 13 |
# File 'lib/praxis/route.rb', line 6 def initialize(verb, path, version='n/a', name:nil, prefixed_path:nil, **) @verb = verb @path = path @version = version @name = name @options = @prefixed_path = prefixed_path end |
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/praxis/route.rb', line 4 def name @name end |
#options ⇒ Object
Returns the value of attribute options.
4 5 6 |
# File 'lib/praxis/route.rb', line 4 def @options end |
#path ⇒ Object
Returns the value of attribute path.
4 5 6 |
# File 'lib/praxis/route.rb', line 4 def path @path end |
#prefixed_path ⇒ Object
Returns the value of attribute prefixed_path.
4 5 6 |
# File 'lib/praxis/route.rb', line 4 def prefixed_path @prefixed_path end |
#verb ⇒ Object
Returns the value of attribute verb.
4 5 6 |
# File 'lib/praxis/route.rb', line 4 def verb @verb end |
#version ⇒ Object
Returns the value of attribute version.
4 5 6 |
# File 'lib/praxis/route.rb', line 4 def version @version end |
Instance Method Details
#describe ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/praxis/route.rb', line 15 def describe result = { verb: verb, path: path.to_s, version: version } result[:name] = name unless name.nil? result[:options] = if .any? result end |