Class: OasCore::OasRoute
- Inherits:
-
Object
- Object
- OasCore::OasRoute
- Defined in:
- lib/oas_core/oas_route.rb
Instance Attribute Summary collapse
-
#controller ⇒ Object
Returns the value of attribute controller.
-
#docstring ⇒ Object
Returns the value of attribute docstring.
-
#method_name ⇒ Object
Returns the value of attribute method_name.
-
#path ⇒ Object
Returns the value of attribute path.
-
#source_string ⇒ Object
Returns the value of attribute source_string.
- #tags(name = nil) ⇒ Object
-
#verb ⇒ Object
Returns the value of attribute verb.
Instance Method Summary collapse
-
#initialize(attributes = {}) ⇒ OasRoute
constructor
A new instance of OasRoute.
- #path_params ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ OasRoute
Returns a new instance of OasRoute.
8 9 10 |
# File 'lib/oas_core/oas_route.rb', line 8 def initialize(attributes = {}) attributes.each { |key, value| send("#{key}=", value) } end |
Instance Attribute Details
#controller ⇒ Object
Returns the value of attribute controller.
5 6 7 |
# File 'lib/oas_core/oas_route.rb', line 5 def controller @controller end |
#docstring ⇒ Object
Returns the value of attribute docstring.
5 6 7 |
# File 'lib/oas_core/oas_route.rb', line 5 def docstring @docstring end |
#method_name ⇒ Object
Returns the value of attribute method_name.
5 6 7 |
# File 'lib/oas_core/oas_route.rb', line 5 def method_name @method_name end |
#path ⇒ Object
Returns the value of attribute path.
5 6 7 |
# File 'lib/oas_core/oas_route.rb', line 5 def path @path end |
#source_string ⇒ Object
Returns the value of attribute source_string.
5 6 7 |
# File 'lib/oas_core/oas_route.rb', line 5 def source_string @source_string end |
#tags(name = nil) ⇒ Object
16 17 18 19 20 |
# File 'lib/oas_core/oas_route.rb', line 16 def (name = nil) return @tags if name.nil? @tags.select { |tag| tag.tag_name.to_s == name.to_s } end |
#verb ⇒ Object
Returns the value of attribute verb.
5 6 7 |
# File 'lib/oas_core/oas_route.rb', line 5 def verb @verb end |
Instance Method Details
#path_params ⇒ Object
12 13 14 |
# File 'lib/oas_core/oas_route.rb', line 12 def path_params @path.to_s.scan(/\{(\w+)\}/).flatten end |