Class: XMLRPC::Marshal

Inherits:
Object
  • Object
show all
Includes:
ParserWriterChooseMixin
Defined in:
lib/xmlrpc/marshal.rb

Overview

Marshalling of XMLRPC::Create#methodCall and XMLRPC::Create#methodResponse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ParserWriterChooseMixin

#set_parser, #set_writer

Constructor Details

#initialize(parser = nil, writer = nil) ⇒ Marshal

class self



41
42
43
44
# File 'lib/xmlrpc/marshal.rb', line 41

def initialize( parser = nil, writer = nil )
  set_parser( parser )
  set_writer( writer )
end

Class Method Details

.dumpObject



36
37
38
# File 'lib/xmlrpc/marshal.rb', line 36

def dump_response( param )
  new.dump_response( param )
end

.dump_call(methodName, *params) ⇒ Object



20
21
22
# File 'lib/xmlrpc/marshal.rb', line 20

def dump_call( methodName, *params )
  new.dump_call( methodName, *params )
end

.dump_response(param) ⇒ Object



24
25
26
# File 'lib/xmlrpc/marshal.rb', line 24

def dump_response( param )
  new.dump_response( param )
end

.loadObject



37
38
39
# File 'lib/xmlrpc/marshal.rb', line 37

def load_response( stringOrReadable )
  new.load_response( stringOrReadable )
end

.load_call(stringOrReadable) ⇒ Object



28
29
30
# File 'lib/xmlrpc/marshal.rb', line 28

def load_call( stringOrReadable )
  new.load_call( stringOrReadable )
end

.load_response(stringOrReadable) ⇒ Object



32
33
34
# File 'lib/xmlrpc/marshal.rb', line 32

def load_response( stringOrReadable )
  new.load_response( stringOrReadable )
end

Instance Method Details

#dump_call(methodName, *params) ⇒ Object



46
47
48
# File 'lib/xmlrpc/marshal.rb', line 46

def dump_call( methodName, *params )
  create.methodCall( methodName, *params )
end

#dump_response(param) ⇒ Object



50
51
52
# File 'lib/xmlrpc/marshal.rb', line 50

def dump_response( param )
  create.methodResponse( ! param.kind_of?( XMLRPC::FaultException ) , param )
end

#load_call(stringOrReadable) ⇒ Object

Returns [ methodname, params ]



55
56
57
# File 'lib/xmlrpc/marshal.rb', line 55

def load_call( stringOrReadable )
  parser.parseMethodCall( stringOrReadable )
end

#load_response(stringOrReadable) ⇒ Object

Returns paramOrFault



60
61
62
# File 'lib/xmlrpc/marshal.rb', line 60

def load_response( stringOrReadable )
  parser.parseMethodResponse( stringOrReadable )[1]
end