Class: Deas::Template::Scope
- Inherits:
-
Object
- Object
- Deas::Template::Scope
- Defined in:
- lib/deas/template.rb
Instance Attribute Summary collapse
-
#sinatra_call ⇒ Object
readonly
Returns the value of attribute sinatra_call.
Instance Method Summary collapse
- #==(other_scope) ⇒ Object
- #escape_html(html) ⇒ Object (also: #h)
- #escape_url(path) ⇒ Object (also: #u)
-
#initialize(sinatra_call) ⇒ Scope
constructor
A new instance of Scope.
- #partial(name, locals = nil) ⇒ Object
- #render(name, options = nil, &block) ⇒ Object
Constructor Details
#initialize(sinatra_call) ⇒ Scope
Returns a new instance of Scope.
36 37 38 |
# File 'lib/deas/template.rb', line 36 def initialize(sinatra_call) @sinatra_call = sinatra_call end |
Instance Attribute Details
#sinatra_call ⇒ Object (readonly)
Returns the value of attribute sinatra_call.
35 36 37 |
# File 'lib/deas/template.rb', line 35 def sinatra_call @sinatra_call end |
Instance Method Details
#==(other_scope) ⇒ Object
58 59 60 61 |
# File 'lib/deas/template.rb', line 58 def ==(other_scope) self.sinatra_call == other_scope.sinatra_call self.class.included_modules == other_scope.class.included_modules end |
#escape_html(html) ⇒ Object Also known as: h
48 49 50 |
# File 'lib/deas/template.rb', line 48 def escape_html(html) Rack::Utils.escape_html(html) end |
#escape_url(path) ⇒ Object Also known as: u
53 54 55 |
# File 'lib/deas/template.rb', line 53 def escape_url(path) Rack::Utils.escape_path(path) end |