Class: Middleman::CoreExtensions::Data::Stores::BaseDataStore

Inherits:
Object
  • Object
show all
Includes:
Contracts
Defined in:
middleman-core/lib/middleman-core/core_extensions/data/stores/base.rb

Direct Known Subclasses

InMemoryDataStore, LocalFileDataStore

Constant Summary

Constants included from Contracts

Contracts::ImmutableSetOf, Contracts::ImmutableSortedSetOf, Contracts::OldResourceList, Contracts::PATH_MATCHER, Contracts::ResourceList, Contracts::VectorOf

Instance Method Summary collapse

Methods included from Contracts

#Contract

Instance Method Details

#[](_k) ⇒ Object

Raises:

  • (NotImplementedError)

18
19
20
# File 'middleman-core/lib/middleman-core/core_extensions/data/stores/base.rb', line 18

def [](_k)
  raise NotImplementedError
end

#key?(_k) ⇒ Boolean

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)

13
14
15
# File 'middleman-core/lib/middleman-core/core_extensions/data/stores/base.rb', line 13

def key?(_k)
  raise NotImplementedError
end

#keysObject

Raises:

  • (NotImplementedError)

23
24
25
# File 'middleman-core/lib/middleman-core/core_extensions/data/stores/base.rb', line 23

def keys
  raise NotImplementedError
end

#to_hObject


33
34
35
36
37
# File 'middleman-core/lib/middleman-core/core_extensions/data/stores/base.rb', line 33

def to_h
  keys.each_with_object({}) do |k, sum|
    sum[k] = self[k]
  end
end

#verticesObject


28
29
30
# File 'middleman-core/lib/middleman-core/core_extensions/data/stores/base.rb', line 28

def vertices
  Hamster::Set.empty
end