Sha256: 485d2c4e78269b8601dfed53aa73177338dd820db407a773246ede8102c8d903

Contents?: true

Size: 515 Bytes

Versions: 3

Compression:

Stored size: 515 Bytes

Contents

module Helium
  class User
    attr_accessor :id, :name, :email, :created_at, :updated_at

    def initialize(client:, params:)
      @client     = client
      @id         = params["id"]
      @name       = params["attributes"]["name"]
      @email      = params["meta"]["email"]
      @created_at = params["meta"]["created"]
      @updated_at = params["meta"]["updated"]
    end

    def created_at
      DateTime.parse(@created_at)
    end

    def updated_at
      DateTime.parse(@updated_at)
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
helium-ruby-0.3.0 lib/helium/user.rb
helium-ruby-0.2.0 lib/helium/user.rb
helium-ruby-0.1.0 lib/helium/user.rb