lib/paid/account.rb in paid-1.0.1 vs lib/paid/account.rb in paid-1.0.2

- old
+ new

@@ -1,17 +1,29 @@ module Paid - class Account < APISingleton - # attribute :object inherited from APISingleton - attribute :id - attribute :business_name - attribute :business_url - attribute :business_logo + class Account < APIResource + attr_reader :id + attr_reader :object + attr_accessor :business_name + attr_accessor :business_url + attr_accessor :business_logo - api_class_method :retrieve, :get, ":path" + def self.retrieve(params={}, headers={}) + method = APIMethod.new(:get, "/account", params, headers, self) + self.new(method.execute, method) + end - def self.path - "/v0/account" + def refresh(params={}, headers={}) + method = APIMethod.new(:get, "/account", params, headers, self) + self.refresh_from(method.execute, method) end - APIClass.register_subclass(self, "account") + # Everything below here is used behind the scenes. + APIResource.register_api_subclass(self, "account") + @api_attributes = { + :id => { :readonly => true }, + :object => { :readonly => true }, + :business_name => nil, + :business_url => nil, + :business_logo => nil + } end end