Class: NRSER::SendSerializer

Inherits:
Object
  • Object
show all
Defined in:
lib/nrser/functions/tree/transform.rb

Instance Method Summary collapse

Constructor Details

#initialize(messages = []) ⇒ SendSerializer

Returns a new instance of SendSerializer.



16
17
18
# File 'lib/nrser/functions/tree/transform.rb', line 16

def initialize messages = []
  @messages = messages
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(symbol, *args, &block) ⇒ Object



20
21
22
23
24
25
26
27
# File 'lib/nrser/functions/tree/transform.rb', line 20

def method_missing symbol, *args, &block
  messages = [
    *@messages,
    ::NRSER::Message.new( symbol, *args, &block )
  ]
  
  self.class.new messages
end

Instance Method Details

#to_proc(publicly: true) ⇒ Object



29
30
31
# File 'lib/nrser/functions/tree/transform.rb', line 29

def to_proc publicly: true
  ::NRSER.chainer @messages, publicly: publicly
end