Class: Dope::View
- Inherits:
-
Object
- Object
- Dope::View
- Defined in:
- lib/dope/core/view.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
Instance Method Summary collapse
-
#initialize(resource) ⇒ View
constructor
A new instance of View.
- #render(ctx) ⇒ Object
Constructor Details
#initialize(resource) ⇒ View
Returns a new instance of View.
5 6 7 |
# File 'lib/dope/core/view.rb', line 5 def initialize(resource) @resource = resource end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
4 5 6 |
# File 'lib/dope/core/view.rb', line 4 def resource @resource end |
Instance Method Details
#render(ctx) ⇒ Object
9 10 11 |
# File 'lib/dope/core/view.rb', line 9 def render(ctx) "hello from #{self} for #{resource} in #{ctx}" end |