Class: Syntax::Respond
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- Syntax::Respond
- Defined in:
- lib/silicon/routing/syntax/respond.rb
Instance Attribute Summary collapse
-
#http_status ⇒ Object
readonly
Returns the value of attribute http_status.
-
#view ⇒ Object
readonly
Returns the value of attribute view.
Instance Method Summary collapse
Instance Attribute Details
#http_status ⇒ Object (readonly)
Returns the value of attribute http_status.
3 4 5 |
# File 'lib/silicon/routing/syntax/respond.rb', line 3 def http_status @http_status end |
#view ⇒ Object (readonly)
Returns the value of attribute view.
3 4 5 |
# File 'lib/silicon/routing/syntax/respond.rb', line 3 def view @view end |
Instance Method Details
#parse ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/silicon/routing/syntax/respond.rb', line 5 def parse if elements.length > 0 elements[0].elements[1].elements.each do |element| if element.is_a? View @view = element.parse end if element.is_a? HttpStatus @http_status = element.parse end end end self end |
#to_hash ⇒ Object
21 22 23 |
# File 'lib/silicon/routing/syntax/respond.rb', line 21 def to_hash {view: @view, http_status: @http_status} end |