Sha256: 521f6b4b95b07af90561870a8595d695d0e99395ca77ad2c22def55c21c67dd0

Contents?: true

Size: 486 Bytes

Versions: 1

Compression:

Stored size: 486 Bytes

Contents

module TimeCamp
  class Resource

    def initialize(response)
      load_attributes(response.with_indifferent_access)
    end

    #################
    # CLASS METHODS #
    #################

    def self.resource_name
      return self.to_s.demodulize.pluralize.downcase
    end

    ####################
    # INSTANCE METHODS #
    ####################

    def attributes
      return Hash[instance_variables.map { |name| [name, instance_variable_get(name)] } ]
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby-timecamp-0.0.2 lib/ruby-timecamp/resource.rb