class Recurly::Resource

This class represents an object as it exists on the Recurly servers. It is generated from a response. If you wish to update or change a resource, you need to send a request to the server and get a new Resource.

Attributes

attributes[R]

Public Class Methods

new(attributes = {}) click to toggle source
# File lib/recurly/resource.rb, line 44
def initialize(attributes = {})
  @attributes = attributes.clone
end

Public Instance Methods

==(other_resource) click to toggle source
# File lib/recurly/resource.rb, line 17
def ==(other_resource)
  self.attributes == other_resource.attributes
end
get_response() click to toggle source
# File lib/recurly/resource.rb, line 34
def get_response
  @response
end
inspect() click to toggle source

Hide instance variables to keep from accidental logging

# File lib/recurly/resource.rb, line 22
def inspect
  "#<#{self.class.name}:#{object_id}} @attributes=#{attributes}>"
end
requires_client?() click to toggle source
# File lib/recurly/resource.rb, line 13
def requires_client?
  false
end
to_json() click to toggle source
# File lib/recurly/resource.rb, line 30
def to_json
  raise NoMethodError, "to_json is not implemented for Resources. Please use Resource#attributes"
end
to_s() click to toggle source
# File lib/recurly/resource.rb, line 26
def to_s
  self.inspect
end

Protected Instance Methods

schema() click to toggle source
# File lib/recurly/resource.rb, line 40
def schema
  self.class.schema
end