Class: PostmanMarkdoc::RequestParser
- Inherits:
-
Object
- Object
- PostmanMarkdoc::RequestParser
- Defined in:
- lib/postman_markdoc/request_parser.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
- #body ⇒ Object
- #description ⇒ Object
- #headers ⇒ Object
-
#initialize(data) ⇒ RequestParser
constructor
A new instance of RequestParser.
- #method ⇒ Object
- #name ⇒ Object
- #request ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(data) ⇒ RequestParser
Returns a new instance of RequestParser.
5 6 7 |
# File 'lib/postman_markdoc/request_parser.rb', line 5 def initialize(data) @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
3 4 5 |
# File 'lib/postman_markdoc/request_parser.rb', line 3 def data @data end |
Instance Method Details
#body ⇒ Object
25 26 27 |
# File 'lib/postman_markdoc/request_parser.rb', line 25 def body request['body']['raw'] end |
#description ⇒ Object
13 14 15 |
# File 'lib/postman_markdoc/request_parser.rb', line 13 def description request['description'] end |
#headers ⇒ Object
21 22 23 |
# File 'lib/postman_markdoc/request_parser.rb', line 21 def headers @headers ||= request['header'] || [] end |
#method ⇒ Object
17 18 19 |
# File 'lib/postman_markdoc/request_parser.rb', line 17 def method request['method'] end |
#name ⇒ Object
9 10 11 |
# File 'lib/postman_markdoc/request_parser.rb', line 9 def name data['name'] end |
#request ⇒ Object
33 34 35 |
# File 'lib/postman_markdoc/request_parser.rb', line 33 def request data['request'] end |
#url ⇒ Object
29 30 31 |
# File 'lib/postman_markdoc/request_parser.rb', line 29 def url request['url']['raw'] end |