class CapicuaGen::Feature
Attributes
generation_attributes[RW]
generator[R]
name[RW]
types[RW]
Public Class Methods
new(attributes= {}) { |self| ... }
click to toggle source
# File lib/CapicuaGen/feature.rb, line 36 def initialize(attributes= {}) initialize_properties(attributes, false) # Configuro los parametros de tipo @types= [] if attributes[:types] @types= attributes[:types] if @types and not @types.instance_of?(Array) @types= [types] end end #Define los atributos de la generación @generation_attributes= AttributeMixer.new # Generador asociado @generator = nil #Ejecuto configuracion en bloque yield self if block_given? end
Public Instance Methods
argv_options()
click to toggle source
# File lib/CapicuaGen/feature.rb, line 132 def argv_options return @generator.argv_options end
clean()
click to toggle source
# File lib/CapicuaGen/feature.rb, line 59 def clean message_helper.puts_generating_feature(self) end
clone(attributes= {})
click to toggle source
Calls superclass method
# File lib/CapicuaGen/feature.rb, line 141 def clone(attributes= {}) result=super() result.initialize_properties(attributes, false) return result end
configure_attributes()
click to toggle source
Configura los atributos personalizados de la característica (antes de establecer el generador)
# File lib/CapicuaGen/feature.rb, line 127 def configure_attributes() end
generate()
click to toggle source
# File lib/CapicuaGen/feature.rb, line 64 def generate message_helper.puts_generating_feature(self) end
generator=(value)
click to toggle source
Configura el generador y se
# File lib/CapicuaGen/feature.rb, line 109 def generator= (value) @generator= value if @generator reset_attributes() @generation_attributes.mixer_base= generator.generation_attributes configure_attributes() end end
get_out_file_information(values= {})
click to toggle source
Devuelve los archivos generados por esta características
# File lib/CapicuaGen/feature.rb, line 70 def get_out_file_information(values= {}) return [] end
get_relative_out_files(values= {})
click to toggle source
Devuelve los archivos generados por esta características
# File lib/CapicuaGen/feature.rb, line 75 def get_relative_out_files(values= {}) result= [] # Obtengo la ruta base if values[:directory_base] directory_base= values[:directory_base] else directory_base= @generation_attributes[:out_dir] end get_out_file_information(values).each do |f| relative_path= f.get_relative_file_path(directory_base) result << relative_path end return result end
is_any_type?(types)
click to toggle source
Indica que el destino es de un tipo determinado
# File lib/CapicuaGen/feature.rb, line 100 def is_any_type?(types) if types and not types.instance_of?(Array) types= [types] end return (@types & types).length > 0 end
is_type?(type)
click to toggle source
Indica que el destino es de un tipo determinado
# File lib/CapicuaGen/feature.rb, line 95 def is_type?(type) return type.include(type) end
message_helper()
click to toggle source
# File lib/CapicuaGen/feature.rb, line 136 def message_helper return MessageHelper.New unless @generator return @generator.message_helper end
reset_attributes()
click to toggle source
Resetea los atributos personalizados de la característica (antes de establecer el generador)
# File lib/CapicuaGen/feature.rb, line 122 def reset_attributes end