Sha256: 7a1673f0f3dfba38404181575f372396f9f56f286bb82085e6d677c57bfdddc6

Contents?: true

Size: 474 Bytes

Versions: 3

Compression:

Stored size: 474 Bytes

Contents

module Epay
  module Model
    attr_accessor :id, :data
    
    def initialize(id, data = {})
      @id = id
      @data = data
    end
    
    def inspect
      inspection = self.class.inspectable_attributes.collect do |name|
        #"#{name}: #{selfsend(name)}"
        "#{name}: #{send(name).inspect}" if respond_to?(name)
      end.join(", ")
      
      "#<#{self.class} #{inspection}>"
    end
    
    def self.inspect
      "inspect via class"
    end
  end 
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
epay-0.0.6 lib/epay/model.rb
epay-0.0.5 lib/epay/model.rb
epay-0.0.4 lib/epay/model.rb