Module: Messaging::Message::Follow

Extended by:
Follow
Included in:
Follow
Defined in:
lib/messaging/message/follow.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.call(preceding_message, subsequent_message = nil, copy: nil, include: nil, exclude: nil, strict: nil) ⇒ Object



6
7
8
# File 'lib/messaging/message/follow.rb', line 6

def self.call(preceding_message, subsequent_message=nil, copy: nil, include: nil, exclude: nil, strict: nil)
  follow(preceding_message, subsequent_message, copy: copy, include: include, exclude: exclude, strict: strict)
end

Instance Method Details

#follow(preceding_message, subsequent_message = nil, copy: nil, include: nil, exclude: nil, strict: nil) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/messaging/message/follow.rb', line 10

def follow(preceding_message, subsequent_message=nil, copy: nil, include: nil, exclude: nil, strict: nil)
  if subsequent_message.nil?
    subsequent_message = self
  end

  if subsequent_message.class == Class
    subsequent_message = subsequent_message.build
  end

  strict = true if strict.nil?

  Copy.(preceding_message, subsequent_message, copy: copy, include: include, exclude: exclude, strict: strict, metadata: false)

  subsequent_message..follow(preceding_message.)

  subsequent_message
end