Class: XDry::Generators::Generator

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, patcher) ⇒ Generator

Returns a new instance of Generator.



13
14
15
16
# File 'lib/xdry/generators_support.rb', line 13

def initialize config, patcher
  @config = config
  @patcher = patcher
end

Instance Attribute Details

#patcherObject (readonly)

Returns the value of attribute patcher.



11
12
13
# File 'lib/xdry/generators_support.rb', line 11

def patcher
  @patcher
end

Class Method Details

.id(value = nil) ⇒ Object



31
32
33
34
# File 'lib/xdry/generators_support.rb', line 31

def self.id(value=nil)
  @id = value if value
  @id
end

.inherited(subclass) ⇒ Object



36
37
38
# File 'lib/xdry/generators_support.rb', line 36

def self.inherited subclass
  ALL << subclass
end

Instance Method Details

#process_attribute(oclass, oattr) ⇒ Object



28
29
# File 'lib/xdry/generators_support.rb', line 28

def process_attribute oclass, oattr
end

#process_class(oclass) ⇒ Object



22
23
24
25
26
# File 'lib/xdry/generators_support.rb', line 22

def process_class oclass
  oclass.attributes.each do |oattr|
    process_attribute oclass, oattr
  end
end

#verbose?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/xdry/generators_support.rb', line 18

def verbose?
  @config.verbose
end