method
positive_integer_writer
positive_integer_writer(name, disp_name=name)
private
Hide source
# File lib/rss/rss.rb, line 474 def positive_integer_writer(name, disp_name=name) module_eval( def #{name}=(new_value) if new_value.nil? @#{name} = new_value else if @do_validate begin tmp = Integer(new_value) raise ArgumentError if tmp <= 0 @#{name} = tmp rescue ArgumentError raise NotAvailableValueError.new('#{disp_name}', new_value) end else @#{name} = new_value.to_i end end end, *get_file_and_line_from_caller(2)) end