Sha256: 52015c502176f994a49430e1b9df91011d67c98414d7a2174244a01da740c913

Contents?: true

Size: 462 Bytes

Versions: 8

Compression:

Stored size: 462 Bytes

Contents

module Lifen
  class Flows < Base

    def initialize(user)
      @user = user
      @collection = []
    end

    attr_reader :collection, :user

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

      json["_embedded"]["flows"].each do |element|
        flow = Flow.new(element)
        flow.user = user

        @collection << flow
      end

      collection
    end

    private

      def client
        @client ||= user.client
      end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
lifen-0.2.1 lib/lifen/flows.rb
lifen-0.2.0 lib/lifen/flows.rb
lifen-0.1.5 lib/lifen/flows.rb
lifen-0.1.4 lib/lifen/flows.rb
lifen-0.1.3 lib/lifen/flows.rb
lifen-0.1.2 lib/lifen/flows.rb
lifen-0.1.1 lib/lifen/flows.rb
lifen-0.1.0 lib/lifen/flows.rb