method
positive_integer_writer
positive_integer_writer(name, disp_name=name)
private
Hide source
# File lib/rss/rss.rb, line 456 def positive_integer_writer(name, disp_name=name) module_eval("def \#{name}=(new_value)\nif new_value.nil?\n@\#{name} = new_value\nelse\nif @do_validate\nbegin\ntmp = Integer(new_value)\nraise ArgumentError if tmp <= 0\n@\#{name} = tmp\nrescue ArgumentError\nraise NotAvailableValueError.new('\#{disp_name}', new_value)\nend\nelse\n@\#{name} = new_value.to_i\nend\nend\nend\n", *get_file_and_line_from_caller(2)) end