date_writer(name, type, disp_name=name) private

No documentation

This method has no description. You can help the Ruby community by adding new notes.

Hide source
# File lib/rss/rss.rb, line 420
    def date_writer(name, type, disp_name=name)
      module_eval(      def #{name}=(new_value)        if new_value.nil?          @#{name} = new_value        elsif new_value.kind_of?(Time)          @#{name} = new_value.dup        else          if @do_validate            begin              @#{name} = Time.__send__('#{type}', new_value)            rescue ArgumentError              raise NotAvailableValueError.new('#{disp_name}', new_value)            end          else            @#{name} = nil            if /\\A\\s*\\z/ !~ new_value.to_s              begin                unless Date._parse(new_value, false).empty?                  @#{name} = Time.parse(new_value)                end              rescue ArgumentError              end            end          end        end        # Is it need?        if @#{name}          class << @#{name}            undef_method(:to_s)            alias_method(:to_s, :#{type})          end        end      end, *get_file_and_line_from_caller(2))
    end
Register or log in to add new notes.