1 package OpenSRF::DomainObject::oilsMethod;
4 JSON->register_class_hint(hint => 'osrfMethod', class => 'OpenSRF::DomainObject::oilsMethod');
9 return JSON->perl2prettyJSON($self) if ($pretty);
10 return JSON->perl2JSON($self);
16 OpenSRF::DomainObject::oilsMethod
20 use OpenSRF::DomainObject::oilsMethod;
22 my $method = OpenSRF::DomainObject::oilsMethod->new( method => 'search' );
24 $method->return_type( 'mods' );
26 $method->params( 'title:harry potter' );
28 $client->send( 'REQUEST', $method );
32 =head2 OpenSRF::DomainObject::oilsMethod->method( [$new_method_name] )
36 Sets or gets the method name that will be called on the server. As above,
37 this can be specified as a build attribute as well as added to a prebuilt
47 $self->{method} = $val if (defined $val);
48 return $self->{method};
51 =head2 OpenSRF::DomainObject::oilsMethod->return_type( [$new_return_type] )
55 Sets or gets the return type for this method call. This can also be supplied as
58 This option does not require that the server return the type you request. It is
59 used as a suggestion when more than one return type or format is possible.
69 $self->{return_type} = $val if (defined $val);
70 return $self->{return_type};
73 =head2 OpenSRF::DomainObject::oilsMethod->params( @new_params )
77 Sets or gets the parameters for this method call. Just pass in either text
78 parameters, or DOM nodes of any type.
88 $self->{params} = \@args if (@args);
89 return @{ $self->{params} };