Sha256: fedddc685dd4190942752d562141116cbb86d9d976f6a343729ef6d7c3e53b01

Contents?: true

Size: 705 Bytes

Versions: 3

Compression:

Stored size: 705 Bytes

Contents

require "redd/thing"

module Redd
  module Object
    class User < Redd::Thing
      require "redd/thing/messageable"

      include Redd::Thing::Messageable

      attr_reader :name
      attr_reader :is_friend
      attr_reader :link_karma
      attr_reader :comment_karma
      attr_reader :gold_creddits
      attr_reader :gold_expiration
      attr_reader :is_gold
      attr_reader :is_mod
      attr_reader :has_verified_email
      attr_reader :has_mod_mail
      attr_reader :has_mail

      alias_method :has_gold, :is_gold

      def created
        @created ||= Time.at(@attributes[:created_utc])
      end

      def fullname
        @fullname ||= "#{kind}_#{id}"
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
redd-0.4.3 lib/redd/object/user.rb
redd-0.4.2 lib/redd/object/user.rb
redd-0.4.1 lib/redd/object/user.rb