Class: Granite::ContextProxy::Data
- Inherits:
-
Object
- Object
- Granite::ContextProxy::Data
- Defined in:
- lib/granite/context_proxy/data.rb
Overview
Contains all the arbitrary data that is passed to BA with ‘with`
Instance Attribute Summary collapse
-
#performer ⇒ Object
readonly
Returns the value of attribute performer.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(performer: nil) ⇒ Data
constructor
A new instance of Data.
Constructor Details
#initialize(performer: nil) ⇒ Data
Returns a new instance of Data.
15 16 17 |
# File 'lib/granite/context_proxy/data.rb', line 15 def initialize(performer: nil) @performer = performer end |
Instance Attribute Details
#performer ⇒ Object (readonly)
Returns the value of attribute performer.
5 6 7 |
# File 'lib/granite/context_proxy/data.rb', line 5 def performer @performer end |
Class Method Details
.wrap(data) ⇒ Object
7 8 9 10 11 12 13 |
# File 'lib/granite/context_proxy/data.rb', line 7 def self.wrap(data) if data.is_a?(self) data else new(**data || {}) end end |