class Datacash::Response::Base
Public Class Methods
key(key, options={})
click to toggle source
# File lib/datacash/response/base.rb, line 24 def self.key(key, options={}) keys[key.to_sym] = options end
keys()
click to toggle source
# File lib/datacash/response/base.rb, line 20 def self.keys @keys ||= {} end
new(attributes = {})
click to toggle source
Calls superclass method
# File lib/datacash/response/base.rb, line 8 def initialize(attributes = {}) self.class.keys.each do |key, options| next unless options.has_key?(:from) from = options[:from].to_sym if attributes.has_key?(from) attributes[key] = attributes.delete(from) end end super(attributes) end
Public Instance Methods
success?()
click to toggle source
# File lib/datacash/response/base.rb, line 28 def success? self[:status].to_i == 1 end