lib/spnet/storage/block_state.rb in spnet-0.1.5 vs lib/spnet/storage/block_state.rb in spnet-0.1.6

- old
+ new

@@ -7,14 +7,14 @@ include Hashmake::HashMakeable # Define arg specs to use in processing hashed arguments during #initialize. ARG_SPECS = { :class_sym => arg_spec(:reqd => true, :type => Symbol), - :port_params => arg_spec_hash(:reqd => false, :type => Object) + :params => arg_spec_hash(:reqd => false, :type => Object) } - attr_reader :class_sym, :hashed_args, :port_params + attr_reader :class_sym, :hashed_args, :params # A new instance of NetworkState. # @param [Hash] args Hashed arguments for initialization. See Network::ARG_SPECS # for details of which keys are required. def initialize args @@ -26,10 +26,10 @@ raise ArgumentError, "args does not have :sample_rate key" unless args.has_key?(:sample_rate) klass = Kernel.const_get(@class_sym) block = klass.new :sample_rate => args[:sample_rate] - @port_params.each do |port_name,value| + @params.each do |port_name,value| if block.in_ports.has_key?(port_name) port = block.in_ports[port_name] port.set_value value end end