Sha256: d1f3794c888954f19c07709ef5cb89efaa7a5e5c455a62bc36c62a530f5f9f33

Contents?: true

Size: 984 Bytes

Versions: 3

Compression:

Stored size: 984 Bytes

Contents

# frozen_string_literal: true
module Shipit
  class AnonymousUser
    def blank?
      true
    end

    def email
      'anonymous@example.com'
    end

    def login
      'anonymous'
    end

    def name
      'Anonymous'
    end

    def avatar_url
      'https://github.com/images/error/octocat_happy.gif'
    end

    def id
    end

    def github_id
    end

    def logged_in?
      false
    end

    def authorized?
      Shipit.authentication_disabled?
    end

    def repositories_contributed_to
      []
    end

    def stacks_contributed_to
      []
    end

    def avatar_uri
      User::DEFAULT_AVATAR.dup
    end

    def created_at
      Time.at(0).utc
    end
    alias_method :updated_at, :created_at

    def read_attribute_for_serialization(attr)
      public_send(attr)
    end

    def github_api
      Shipit.github.api
    end

    def serializer_class
      AnonymousUserSerializer
    end

    def marked_for_destruction?
      true
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
shipit-engine-0.35.1 app/models/shipit/anonymous_user.rb
shipit-engine-0.35.0 app/models/shipit/anonymous_user.rb
shipit-engine-0.34.0 app/models/shipit/anonymous_user.rb