Class: Reativo::Cell::Component

Inherits:
Trailblazer::Cell
  • Object
show all
Includes:
Cell::Caching::Notifications, React::Rails::ViewHelper
Defined in:
app/models/reativo/cell/component.rb

Instance Method Summary collapse

Instance Method Details

#cache?(*args) ⇒ Boolean

Returns:

  • (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

#componentObject



16
17
18
# File 'app/models/reativo/cell/component.rb', line 16

def component
  self.context[:component]
end

#datamodelObject



12
13
14
# File 'app/models/reativo/cell/component.rb', line 12

def datamodel
  operation[:model]
end

#operationObject



26
27
28
# File 'app/models/reativo/cell/component.rb', line 26

def operation
  model
end

#propsObject



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