Class: Distelli::ClientBase

Inherits:
Object
  • Object
show all
Defined in:
lib/distelli/clientframework.rb

Instance Method Summary collapse

Constructor Details

#initialize(credentials, endpoint = nil) ⇒ ClientBase

Returns a new instance of ClientBase.



105
106
107
108
109
110
111
# File 'lib/distelli/clientframework.rb', line 105

def initialize(credentials, endpoint=nil)
  @credentials = credentials
  @endpoint = endpoint
  @json_marshaller = JsonMarshaller.new
  @xml_marshaller = XmlMarshaller.new
  @logger = Logging::Logger['ClientBase']
end

Instance Method Details

#set_endpoint(endpoint) ⇒ Object



113
114
115
116
117
118
119
120
121
122
123
# File 'lib/distelli/clientframework.rb', line 113

def set_endpoint(endpoint)
  if endpoint == nil
    return
  end
  if endpoint.start_with?("http://") or endpoint.start_with?("https://")
    @endpoint = endpoint
  else
    @endpoint = "http://"+endpoint
  end

end