Sha256: e4f842765f889296361525210296c055381fc1a814c6b6286c604ae774d13453

Contents?: true

Size: 350 Bytes

Versions: 6

Compression:

Stored size: 350 Bytes

Contents

module Lifen
  class Status

    include Virtus.model(finalize: false)

    attribute :user, "Lifen::User"

    attribute :unread, Integer, default: 0

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

      self.unread    = json["unread"]
    end

    private

      def client
        @client ||= user.client
      end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
lifen-1.3.0 lib/lifen/status.rb
lifen-1.2.0 lib/lifen/status.rb
lifen-1.1.0 lib/lifen/status.rb
lifen-1.0.2 lib/lifen/status.rb
lifen-1.0.1 lib/lifen/status.rb
lifen-1.0.0 lib/lifen/status.rb