Method: Miu::Messages::Base#initialize

Defined in:
lib/miu/messages/base.rb

#initialize(options = {}) {|_self| ... } ⇒ Base

Returns a new instance of Base.

Yields:

  • (_self)

Yield Parameters:



11
12
13
14
15
16
17
18
# File 'lib/miu/messages/base.rb', line 11

def initialize(options = {})
  @id = options[:id] || SecureRandom.uuid
  @time = options[:time] || Time.now.to_i
  @network = Miu::Utility.adapt(Resources::Network, options[:network] || {})
  @type = options[:type]
  @content = options[:content]
  yield self if block_given?
end