class SK::SDK::Base
Public Class Methods
headers()
click to toggle source
If headers are not defined in a given subclass, then obtain headers from the superclass.
# File lib/sk_sdk/base.rb, line 55 def self.headers if defined?(@headers) @headers elsif superclass != Object && superclass.headers superclass.headers else @headers ||= {} end end
new(attributes = {}, *args)
click to toggle source
Calls superclass method
# File lib/sk_sdk/base.rb, line 21 def initialize(attributes = {}, *args) attr = attributes[self.class.element_name] || attributes super(attr, *args) end
set_connection(opts)
click to toggle source
Define the connection to be used when talking to a salesking server
Private Class Methods
site_api_url(site)
click to toggle source
# File lib/sk_sdk/base.rb, line 67 def self.site_api_url(site) site = site.gsub(/\/$/, '') site =~ /\/api$/ ? site : "#{site}/api" end
Public Instance Methods
save()
click to toggle source
# File lib/sk_sdk/base.rb, line 32 def save; save_with_validation; end