Class: XMLRPC::Marshal

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ParserWriterChooseMixin

#set_parser, #set_writer

Constructor Details

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

instance methods ----------------------------



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

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

Class Method Details

.dump_call(methodName, *params) ⇒ Object



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

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

.dump_response(param) ⇒ Object Also known as: dump



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

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

.load_call(stringOrReadable) ⇒ Object



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

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

.load_response(stringOrReadable) ⇒ Object Also known as: load



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

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

Instance Method Details

#dump_call(methodName, *params) ⇒ Object



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

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

#dump_response(param) ⇒ Object



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

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

#load_call(stringOrReadable) ⇒ Object

returns [ methodname, params ]



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

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

#load_response(stringOrReadable) ⇒ Object

returns paramOrFault



69
70
71
# File 'lib/xmlrpc/marshal.rb', line 69

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