Class: ORB::RenderContext
- Inherits:
-
Object
- Object
- ORB::RenderContext
- Defined in:
- lib/orb/render_context.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
- #binding ⇒ Object
- #has_key?(key) ⇒ Boolean
-
#initialize(assigns = {}) ⇒ RenderContext
constructor
A new instance of RenderContext.
Constructor Details
#initialize(assigns = {}) ⇒ RenderContext
Returns a new instance of RenderContext.
5 6 7 8 |
# File 'lib/orb/render_context.rb', line 5 def initialize(assigns = {}) @assigns = assigns @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
22 23 24 |
# File 'lib/orb/render_context.rb', line 22 def errors @errors end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/orb/render_context.rb', line 14 def [](key) resolve(key) end |
#[]=(key, value) ⇒ Object
10 11 12 |
# File 'lib/orb/render_context.rb', line 10 def []=(key, value) @assigns[key] = value end |
#binding ⇒ Object
24 25 26 27 28 |
# File 'lib/orb/render_context.rb', line 24 def binding # rubocop:disable Style/OpenStructUse OpenStruct.new(@assigns).instance_eval { binding } # rubocop:enable Style/OpenStructUse end |
#has_key?(key) ⇒ Boolean
18 19 20 |
# File 'lib/orb/render_context.rb', line 18 def has_key?(key) resolve(key) != nil end |