Class: Rapid::Common::PayloadDispatch

Inherits:
Object
  • Object
show all
Defined in:
lib/ury_rapid/common/payload.rb

Overview

Method object for processing a payload and sending the results

Constant Summary collapse

PROTOCOL_SPLITTER =
'://'
TYPES =

The order of these is important - place specific types before more general ones

hash url integer float string

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(body, receiver) ⇒ PayloadDispatch


76
77
78
79
# File 'lib/ury_rapid/common/payload.rb', line 76

def initialize(body, receiver)
  @body = body
  @receiver = receiver
end

Class Method Details

.dispatch(*args) ⇒ Object


89
90
91
# File 'lib/ury_rapid/common/payload.rb', line 89

def self.dispatch(*args)
  new(*args).run
end

Instance Method Details

#runObject


85
86
87
# File 'lib/ury_rapid/common/payload.rb', line 85

def run
  TYPES.any?(&method(:try_type))
end