Sha256: 1c53874ba1f6c20ae92afa167539b3167e8f5e6581231a7f6be504d1aa779559

Contents?: true

Size: 387 Bytes

Versions: 20

Compression:

Stored size: 387 Bytes

Contents

module Lifen
  class Status

    include Virtus.model(finalize: false)

    attribute :user, "Lifen::User"

    attribute :unread, Integer, default: 0

    def reload
      json = client.get("central/api/chats/status")

      self.unread    = json["unread"]

      self
    end

    alias refresh reload

    private

      def client
        @client ||= user.client
      end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
lifen-4.0.0 lib/lifen/status.rb
lifen-3.0.0 lib/lifen/status.rb
lifen-2.4.0 lib/lifen/status.rb
lifen-2.3.0 lib/lifen/status.rb
lifen-2.2.0 lib/lifen/status.rb
lifen-2.1.0 lib/lifen/status.rb
lifen-2.0.0 lib/lifen/status.rb
lifen-1.6.8 lib/lifen/status.rb
lifen-1.6.7 lib/lifen/status.rb
lifen-1.6.6 lib/lifen/status.rb
lifen-1.6.5 lib/lifen/status.rb
lifen-1.6.4 lib/lifen/status.rb
lifen-1.6.3 lib/lifen/status.rb
lifen-1.6.2 lib/lifen/status.rb
lifen-1.6.1 lib/lifen/status.rb
lifen-1.6.0 lib/lifen/status.rb
lifen-1.5.2 lib/lifen/status.rb
lifen-1.5.1 lib/lifen/status.rb
lifen-1.5.0 lib/lifen/status.rb
lifen-1.4.0 lib/lifen/status.rb