Sha256: c1068aa0a23ba68a0d55d86fb73131b0ba604b6073ac6987422d9a557b5d70b5

Contents?: true

Size: 406 Bytes

Versions: 1

Compression:

Stored size: 406 Bytes

Contents

module Helium
  class User < Resource
    attr_reader :name, :email

    def initialize(client:, params:)
      super(client: client, params: params)

      @name  = params.dig('attributes', 'name')
      @email = params.dig('meta', 'email')
    end

    # TODO can probably generalize this a bit more
    def as_json
      super.merge({
        name: name,
        email: email
      })
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
helium-ruby-0.4.0 lib/helium/user.rb