Module: Hg::Chunk::Initializer

Defined in:
lib/hg/chunk.rb

Instance Method Summary collapse

Instance Method Details

#initialize(recipient: nil, context: nil) ⇒ Object



63
64
65
66
67
68
69
70
71
72
73
74
75
# File 'lib/hg/chunk.rb', line 63

def initialize(recipient: nil, context: nil)
  # TODO: test
  # Ensure recipient is transformed into a Hash
  if recipient.is_a? Hash
    @recipient = recipient
  else
    @recipient = {
      'id': recipient
    }
  end

  @context = HashWithIndifferentAccess.new(context)
end