Class: Gemgate::SpecsIndex
- Inherits:
-
Object
- Object
- Gemgate::SpecsIndex
- Defined in:
- lib/gemgate/specs_index.rb
Instance Attribute Summary collapse
-
#conditions ⇒ Object
readonly
Returns the value of attribute conditions.
-
#storage ⇒ Object
Returns the value of attribute storage.
Instance Method Summary collapse
- #add(gem) ⇒ Object
-
#initialize(filename) ⇒ SpecsIndex
constructor
A new instance of SpecsIndex.
Constructor Details
#initialize(filename) ⇒ SpecsIndex
Returns a new instance of SpecsIndex.
6 7 8 9 |
# File 'lib/gemgate/specs_index.rb', line 6 def initialize(filename) @filename = filename @conditions = [] end |
Instance Attribute Details
#conditions ⇒ Object (readonly)
Returns the value of attribute conditions.
4 5 6 |
# File 'lib/gemgate/specs_index.rb', line 4 def conditions @conditions end |
#storage ⇒ Object
Returns the value of attribute storage.
3 4 5 |
# File 'lib/gemgate/specs_index.rb', line 3 def storage @storage end |
Instance Method Details
#add(gem) ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/gemgate/specs_index.rb', line 11 def add(gem) if conditions.all? {|c| c.call(gem) } update_with(gem) else ensure_exists end end |