Package restxclient :: Module restx_parameter
[hide private]
[frames] | no frames]

Module restx_parameter

source code

RESTx: Sane, simple and effective data publishing and integration.

Copyright (C) 2010 MuleSoft Inc. http://www.mulesoft.com

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

Classes [hide private]
  RestxParameter
Represents a parameter for a RESTx resource or service.
Functions [hide private]
Integer or Float
_numstr_to_num(x)
Translate a string to a numeric value.
source code
boolean
_bool_convert(x)
Translate a string to a boolean value.
source code
Variables [hide private]
  __package__ = 'restxclient'

Imports: RestxClientException


Function Details [hide private]

_numstr_to_num(x)

source code 

Translate a string to a numeric value.

This sort of translation function is necessary to be more flexible in handling the type of input for parameter values.

Parameters:
  • x (string or number type) - String representing a number or a number type.
Returns: Integer or Float
Numeric value

_bool_convert(x)

source code 

Translate a string to a boolean value.

This sort of translation function is necessary to be more flexible in handling the type of input for parameter values.

Strings like 'y', 'yes', 'true', 't', '1' are interpreted as True, all other strings are considered to mean False.

It works for upper and lower-case strings.

Parameters:
  • x (string or boolean) - String representation of a boolean value or a boolean.
Returns: boolean
Boolean value.