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



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

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

Class Method Details

.dumpObject



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

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

.dump_call(methodName, *params) ⇒ Object



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

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

.dump_response(param) ⇒ Object



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

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

.loadObject



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

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

.load_call(stringOrReadable) ⇒ Object



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

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

.load_response(stringOrReadable) ⇒ Object



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

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

Instance Method Details

#dump_call(methodName, *params) ⇒ Object



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

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

#dump_response(param) ⇒ Object



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

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

#load_call(stringOrReadable) ⇒ Object

Returns [ methodname, params ]



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

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

#load_response(stringOrReadable) ⇒ Object

Returns paramOrFault



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

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