1 package OpenSRF::DomainObject::oilsMethod;
4 JSON->register_class_hint(hint => 'osrfMethod', name => 'OpenSRF::DomainObject::oilsMethod', type => 'hash');
9 return JSON->perl2prettyJSON($self) if ($pretty);
10 return JSON->perl2JSON($self);
15 my $class = ref($self) || $self;
17 return bless \%args => $class;
23 OpenSRF::DomainObject::oilsMethod
27 use OpenSRF::DomainObject::oilsMethod;
29 my $method = OpenSRF::DomainObject::oilsMethod->new( method => 'search' );
31 $method->return_type( 'mods' );
33 $method->params( 'title:harry potter' );
35 $client->send( 'REQUEST', $method );
39 =head2 OpenSRF::DomainObject::oilsMethod->method( [$new_method_name] )
43 Sets or gets the method name that will be called on the server. As above,
44 this can be specified as a build attribute as well as added to a prebuilt
54 $self->{method} = $val if (defined $val);
55 return $self->{method};
58 =head2 OpenSRF::DomainObject::oilsMethod->return_type( [$new_return_type] )
62 Sets or gets the return type for this method call. This can also be supplied as
65 This option does not require that the server return the type you request. It is
66 used as a suggestion when more than one return type or format is possible.
76 $self->{return_type} = $val if (defined $val);
77 return $self->{return_type};
80 =head2 OpenSRF::DomainObject::oilsMethod->params( @new_params )
84 Sets or gets the parameters for this method call. Just pass in either text
85 parameters, or DOM nodes of any type.
95 $self->{params} = \@args if (@args);
96 return @{ $self->{params} };