class HermesAPI::Base

Public Class Methods

new(attributes = {}, persisted = false) click to toggle source
Calls superclass method
# File lib/hermes_api/resources/base.rb, line 25
def initialize(attributes = {}, persisted = false)
  if defined?(self.class::DEFAULT_ATTRS)
    attributes = self.class::DEFAULT_ATTRS.merge(attributes)
  end
  super
end
root() click to toggle source
# File lib/hermes_api/resources/base.rb, line 10
def root
  nil
end
with_session(user, password) { || ... } click to toggle source
# File lib/hermes_api/resources/base.rb, line 14
def with_session(user, password)
  existing_user = self.user
  existing_password = self.password
  self.user = user
  self.password = password
  yield
  self.user = existing_user
  self.password = existing_password
end

Public Instance Methods

load(attributes, remove_root = false, persisted = false) click to toggle source
Calls superclass method
# File lib/hermes_api/resources/base.rb, line 32
def load(attributes, remove_root = false, persisted = false)
  attributes.deep_transform_keys! { |k| k.to_s.underscore }
  super
end
to_xml(options = {}) click to toggle source
Calls superclass method
# File lib/hermes_api/resources/base.rb, line 37
def to_xml(options = {})
  super({root: self.class.root, camelize: :lower}.merge(options))
end