Class: Cell::ViewModel::Context

Inherits:
Object
  • Object
show all
Defined in:
lib/cell/view_model.rb

Overview

DISCUSS: we could use the same mechanism as TRB::Skills here for speed at runtime?

Class Method Summary collapse

Class Method Details

.[](options, context) ⇒ Object

Only dup&merge when :context was passed in parent.cell(context: ..) Otherwise we can simply pass on the old context.



82
83
84
85
# File 'lib/cell/view_model.rb', line 82

def self.[](options, context)
  return context unless options
  context.dup.merge(options) # DISCUSS: should we create a real Context object here, to make it overridable?
end