Class: Reativo::Cell::Component
- Inherits:
-
Trailblazer::Cell
- Object
- Trailblazer::Cell
- Reativo::Cell::Component
- Includes:
- Cell::Caching::Notifications, React::Rails::ViewHelper
- Defined in:
- app/models/reativo/cell/component.rb
Instance Method Summary collapse
- #cache?(*args) ⇒ Boolean
- #component ⇒ Object
- #datamodel ⇒ Object
- #operation ⇒ Object
- #props ⇒ Object
Instance Method Details
#cache?(*args) ⇒ Boolean
30 31 32 33 34 |
# File 'app/models/reativo/cell/component.rb', line 30 def cache?(*args) return false if self.context[:result].nil? return true if self.context[:result][:cache_key] false end |
#component ⇒ Object
16 17 18 |
# File 'app/models/reativo/cell/component.rb', line 16 def component self.context[:component] end |
#datamodel ⇒ Object
12 13 14 |
# File 'app/models/reativo/cell/component.rb', line 12 def datamodel operation[:model] end |
#operation ⇒ Object
26 27 28 |
# File 'app/models/reativo/cell/component.rb', line 26 def operation model end |
#props ⇒ Object
20 21 22 23 24 |
# File 'app/models/reativo/cell/component.rb', line 20 def props result = self.context[:result] || {} additional_props = result[:view] || {} self.context[:props].merge!(additional_props) end |