Class: CompareLinker::GemDictionary
- Inherits:
-
Object
- Object
- CompareLinker::GemDictionary
- Defined in:
- lib/compare_linker/gem_dictionary.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize ⇒ GemDictionary
constructor
A new instance of GemDictionary.
-
#lookup(gem_name) ⇒ Array<String>, Array<NilClass>
Look gem info up from Dictionary.
Constructor Details
#initialize ⇒ GemDictionary
Returns a new instance of GemDictionary.
7 8 9 |
# File 'lib/compare_linker/gem_dictionary.rb', line 7 def initialize @file = File.join(__dir__, '../../data/rubygems.yml') end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
5 6 7 |
# File 'lib/compare_linker/gem_dictionary.rb', line 5 def file @file end |
Instance Method Details
#lookup(gem_name) ⇒ Array<String>, Array<NilClass>
Look gem info up from Dictionary
16 17 18 19 20 21 22 23 24 |
# File 'lib/compare_linker/gem_dictionary.rb', line 16 def lookup(gem_name) repo_full_name = rubygems[gem_name] if repo_full_name repo_full_name.split("/") else [nil, nil] end end |