Class: Wings::View
Instance Attribute Summary collapse
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ View
constructor
A new instance of View.
Constructor Details
#initialize(attrs) ⇒ View
Returns a new instance of View.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/wings/view.rb', line 7 def initialize(attrs) @env = attrs[:env] @headers = attrs[:headers] || {} @template = attrs[:template] @local_vars = attrs[:local_vars] || {} @controller = attrs[:controller] @instance_vars = attrs[:instance_vars] || {} @text = get_text @status = attrs[:status] || 200 @headers['Content-Type'] ||= 'text/html' end |
Instance Attribute Details
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
5 6 7 |
# File 'lib/wings/view.rb', line 5 def headers @headers end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
5 6 7 |
# File 'lib/wings/view.rb', line 5 def status @status end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
5 6 7 |
# File 'lib/wings/view.rb', line 5 def text @text end |