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.
- #logger ⇒ Object
- #partial(name, locals = nil, &block) ⇒ Object
- #render(name, options = nil, &block) ⇒ Object
Constructor Details
#initialize(sinatra_call) ⇒ Scope
Returns a new instance of Scope.
46 47 48 |
# File 'lib/deas/template.rb', line 46 def initialize(sinatra_call) @sinatra_call = sinatra_call end |
Instance Attribute Details
#sinatra_call ⇒ Object (readonly)
Returns the value of attribute sinatra_call.
44 45 46 |
# File 'lib/deas/template.rb', line 44 def sinatra_call @sinatra_call end |
Instance Method Details
#==(other_scope) ⇒ Object
72 73 74 75 |
# File 'lib/deas/template.rb', line 72 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
58 59 60 |
# File 'lib/deas/template.rb', line 58 def escape_html(html) Rack::Utils.escape_html(html) end |
#escape_url(path) ⇒ Object Also known as: u
63 64 65 |
# File 'lib/deas/template.rb', line 63 def escape_url(path) Rack::Utils.escape_path(path) end |
#logger ⇒ Object
68 69 70 |
# File 'lib/deas/template.rb', line 68 def logger @sinatra_call.logger end |