guestbook.rb
# Add a signature to the book if not already signed
Add a signature to the book if not already signed
Add a signature to the book if not already signed
def add(name_to_add)
        unless @signatures.key?(name_to_add)
            @signatures.store(name_to_add, Time.now)
        else
            raise RuntimeError.new "#{name_to_add} already signed on #{@signatures[name_to_add]}"
        end
        return "Successfully added #{name_to_add} at #{@signatures[name_to_add]}"
    end
def add ( name_to_add ) unless @signatures . key? ( name_to_add ) @signatures . store ( name_to_add , Time . now ) else raise RuntimeError . new "#{name_to_add} already signed on #{@signatures[name_to_add]}" end return "Successfully added #{name_to_add} at #{@signatures[name_to_add]}" end
Add a signature to the book if not already signed
Add a signature to the book if not already signed
name_to_add
<not_specific>