Class: Tapioca::RepoIndex
- Inherits:
-
Object
- Object
- Tapioca::RepoIndex
- Defined in:
- lib/tapioca/repo_index.rb
Class Method Summary collapse
-
.from_hash(hash) ⇒ Object
: (Hash[String, Hash[untyped, untyped]] hash) -> RepoIndex.
-
.from_json(json) ⇒ Object
: (String json) -> RepoIndex.
Instance Method Summary collapse
-
#<<(gem_name) ⇒ Object
: (String gem_name) -> void.
-
#gems ⇒ Object
: -> Enumerable.
-
#has_gem?(gem_name) ⇒ Boolean
: (String gem_name) -> bool.
-
#initialize ⇒ RepoIndex
constructor
: -> void.
Constructor Details
#initialize ⇒ RepoIndex
: -> void
21 22 23 |
# File 'lib/tapioca/repo_index.rb', line 21 def initialize @entries = Set.new #: Set[String] end |
Class Method Details
Instance Method Details
#<<(gem_name) ⇒ Object
: (String gem_name) -> void
26 27 28 |
# File 'lib/tapioca/repo_index.rb', line 26 def <<(gem_name) @entries.add(gem_name) end |
#gems ⇒ Object
: -> Enumerable
31 32 33 |
# File 'lib/tapioca/repo_index.rb', line 31 def gems @entries.sort end |
#has_gem?(gem_name) ⇒ Boolean
: (String gem_name) -> bool
36 37 38 |
# File 'lib/tapioca/repo_index.rb', line 36 def has_gem?(gem_name) @entries.include?(gem_name) end |