Class: Stratagem::Model::Containers::Gem
- Includes:
- Enumerable
- Defined in:
- lib/stratagem/model/containers/gem.rb
Instance Method Summary collapse
- #each ⇒ Object
- #export(options = nil) ⇒ Object
-
#initialize(app_model) ⇒ Gem
constructor
A new instance of Gem.
- #names ⇒ Object
Constructor Details
#initialize(app_model) ⇒ Gem
Returns a new instance of Gem.
5 6 7 8 |
# File 'lib/stratagem/model/containers/gem.rb', line 5 def initialize(app_model) @app_model = app_model @gems = ::Gem.loaded_specs end |
Instance Method Details
#each ⇒ Object
21 22 23 |
# File 'lib/stratagem/model/containers/gem.rb', line 21 def each @gems.each {|spec| yield spec } end |
#export(options = nil) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/stratagem/model/containers/gem.rb', line 14 def export(=nil) @gems.map {|g| name, spec = g [name, {:version => spec.version.version}] } end |
#names ⇒ Object
10 11 12 |
# File 'lib/stratagem/model/containers/gem.rb', line 10 def names @gems.map {|g| g[0] } end |