Class: Butterfly::CodeGenerators::GeneratorGroup

Inherits:
Object
  • Object
show all
Defined in:
lib/butterfly.rb

Overview

a generator-group contains a generator name, its path and its generator-types

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file) ⇒ GeneratorGroup

Returns a new instance of GeneratorGroup.



85
86
87
88
89
# File 'lib/butterfly.rb', line 85

def initialize(file)
  @name = File.basename(file).gsub(/_generators$/, '')
  @source = RubiGen::PathSource.new(:app, file)
  @types = @source.names(:visible)
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



83
84
85
# File 'lib/butterfly.rb', line 83

def name
  @name
end

#sourceObject

Returns the value of attribute source.



83
84
85
# File 'lib/butterfly.rb', line 83

def source
  @source
end

#typesObject

Returns the value of attribute types.



83
84
85
# File 'lib/butterfly.rb', line 83

def types
  @types
end