Class: ApipieBindings::Example
- Inherits:
-
Object
- Object
- ApipieBindings::Example
- Defined in:
- lib/apipie_bindings/example.rb
Instance Attribute Summary collapse
-
#args ⇒ Object
readonly
Returns the value of attribute args.
-
#http_method ⇒ Object
readonly
Returns the value of attribute http_method.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_method, path, args, status, response) ⇒ Example
constructor
A new instance of Example.
Constructor Details
#initialize(http_method, path, args, status, response) ⇒ Example
Returns a new instance of Example.
7 8 9 10 11 12 13 |
# File 'lib/apipie_bindings/example.rb', line 7 def initialize(http_method, path, args, status, response) @http_method = http_method @path = path @args = args @status = status.to_i @response = response end |
Instance Attribute Details
#args ⇒ Object (readonly)
Returns the value of attribute args.
5 6 7 |
# File 'lib/apipie_bindings/example.rb', line 5 def args @args end |
#http_method ⇒ Object (readonly)
Returns the value of attribute http_method.
5 6 7 |
# File 'lib/apipie_bindings/example.rb', line 5 def http_method @http_method end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/apipie_bindings/example.rb', line 5 def path @path end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
5 6 7 |
# File 'lib/apipie_bindings/example.rb', line 5 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/apipie_bindings/example.rb', line 5 def status @status end |
Class Method Details
.parse(example) ⇒ Object
15 16 17 18 |
# File 'lib/apipie_bindings/example.rb', line 15 def self.parse(example) prep = /(\w+)\ ([^\n]*)\n?(.*)?\n(\d+)\n(.*)/m.match(example) new(*prep[1..5]) if prep end |