Class: Granite::ContextProxy::Data

Inherits:
Object
  • Object
show all
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

Class Method Summary collapse

Instance Method Summary collapse

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

#performerObject (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