Sha256: 1ec4c294b3655dcfc6887aba47d015f5303e70323b86d614095c0faab995d8bf

Contents?: true

Size: 385 Bytes

Versions: 13

Compression:

Stored size: 385 Bytes

Contents

class Progressrus
  class Store < Array
    def initialize(default)
      @default = default
      self << default
    end

    def default
      @default
    end

    def default!
      clear
      self << default
    end

    def find_by_name(name)
      return first if name == :first
      return last  if name == :last

      find { |store| store.name == name }
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
progressrus-0.1.8 lib/progressrus/store.rb
progressrus-0.1.7 lib/progressrus/store.rb
progressrus-0.1.6 lib/progressrus/store.rb
progressrus-0.1.5 lib/progressrus/store.rb
progressrus-0.1.4 lib/progressrus/store.rb
progressrus-0.1.3 lib/progressrus/store.rb
progressrus-0.1.2 lib/progressrus/store.rb
progressrus-0.1.1 lib/progressrus/store.rb
progressrus-0.1.0 lib/progressrus/store.rb
progressrus-0.0.4 lib/progressrus/store.rb
progressrus-0.0.3 lib/progressrus/store.rb
progressrus-0.0.2 lib/progressrus/store.rb
progressrus-0.0.1 lib/progressrus/store.rb