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 45 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) other_resource.is_a?(Recurly::Resource) && attributes == other_resource.attributes end
get_response()
click to toggle source
# File lib/recurly/resource.rb, line 35 def get_response @response end
inspect()
click to toggle source
Hide instance variables to keep from accidental logging
# File lib/recurly/resource.rb, line 23 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 31 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 27 def to_s self.inspect end
Protected Instance Methods
schema()
click to toggle source
# File lib/recurly/resource.rb, line 41 def schema self.class.schema end