Sha256: 2f1f9144884b1c0b57dc471d9cb797ce854b8e319f825ae8c6c986f2918eaad6

Contents?: true

Size: 575 Bytes

Versions: 12

Compression:

Stored size: 575 Bytes

Contents

module Eternity
  class Branch
    class << self

      def [](name)
        Commit.new branches[name]
      end

      def []=(name, commit_id)
        branches[name] = commit_id
      end

      def exists?(name)
        branches.key? name
      end

      def delete(name)
        branches.delete name
      end

      def names
        branches.keys
      end

      private

      def branches
        @branches ||= Restruct::Hash.new connection: Eternity.connection,
                                         id: Eternity.keyspace[:branches]
      end

    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
eternity-4.0.0 lib/eternity/branch.rb
eternity-3.0.1 lib/eternity/branch.rb
eternity-3.0.0 lib/eternity/branch.rb
eternity-2.0.1 lib/eternity/branch.rb
eternity-2.0.0 lib/eternity/branch.rb
eternity-1.1.1 lib/eternity/branch.rb
eternity-1.1.0 lib/eternity/branch.rb
eternity-1.0.0 lib/eternity/branch.rb
eternity-0.1.3 lib/eternity/branch.rb
eternity-0.1.2 lib/eternity/branch.rb
eternity-0.1.1 lib/eternity/branch.rb
eternity-0.1.0 lib/eternity/branch.rb