Sha256: 52e5f5c3918b32fc853d02ac2f16553fcb59372e8f46b262003357c63efd3eea
Contents?: true
Size: 993 Bytes
Versions: 1
Compression:
Stored size: 993 Bytes
Contents
module ActionWebService # :nodoc: module Client # :nodoc: class ClientError < StandardError # :nodoc: end class Base # :nodoc: def initialize(api, endpoint_uri) @api = api @endpoint_uri = endpoint_uri end def method_missing(name, *args) # :nodoc: call_name = method_name(name) return super(name, *args) if call_name.nil? perform_invocation(call_name, args) end protected def perform_invocation(method_name, args) # :nodoc: raise NotImplementedError, "use a protocol-specific client" end private def method_name(name) if @api.has_api_method?(name.to_sym) name.to_s elsif @api.has_public_api_method?(name.to_s) @api.api_method_name(name.to_s).to_s else nil end end def lookup_class(klass) klass.is_a?(Hash) ? klass.values[0] : klass end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
actionwebservice-0.5.0 | lib/action_web_service/client/base.rb |