spec/fake_app/server.rb in validates_host-1.1.0 vs spec/fake_app/server.rb in validates_host-1.2.0
- old
+ new
@@ -1,17 +1,19 @@
+# frozen_string_literal: true
+
class Server
include ActiveModel::Validations
include ActiveModel::Conversion
extend ActiveModel::Naming
attr_accessor :domain_name, :host_name, :ip
- validates :domain_name, :domain_name => true
- validates :host_name, :host_name => true
- validates :ip, :ip => true
+ validates :domain_name, domain_name: true
+ validates :host_name, host_name: true
+ validates :ip, ip: true
def initialize(attributes = {})
attributes.each do |name, value|
send("#{name}=", value)
end
end
-end
\ No newline at end of file
+end