Class: ObjectiveCommand::Datas::Factory
- Inherits:
-
ObjectiveCommand::Datas.selfself::Data
- Object
- ObjectiveCommand::Datas.selfself::Data
- ObjectiveCommand::Datas::Factory
- Defined in:
- lib/objective_command/datas/factory.rb
Instance Attribute Summary collapse
-
#command_data_class ⇒ Object
Returns the value of attribute command_data_class.
Instance Method Summary collapse
- #create(*a, &b) ⇒ Object
-
#initialize(values = {}, *a, &b) ⇒ Factory
constructor
A new instance of Factory.
- #new_command_data(*a, &b) ⇒ Object
Constructor Details
Instance Attribute Details
#command_data_class ⇒ Object
Returns the value of attribute command_data_class.
12 13 14 |
# File 'lib/objective_command/datas/factory.rb', line 12 def command_data_class @command_data_class end |
Instance Method Details
#create(*a, &b) ⇒ Object
33 34 35 |
# File 'lib/objective_command/datas/factory.rb', line 33 def create ( *a, &b ) new_command_data(*a, &b) end |
#new_command_data(*a, &b) ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/objective_command/datas/factory.rb', line 22 def new_command_data ( *a, &b ) data = @command_data_class.new(*a, &b) instance_variables.each do |var| next if var == '@command_data_class' next if var =~ /^@__/ val = instance_variable_get(var) data.send(var[1..-1] + '=', val) unless val.nil? end data end |