class Joey::Location
Public Instance Methods
valid?()
click to toggle source
# File lib/joey/location.rb, line 11 def valid? self.validate puts self.errors.inspect unless self.errors.empty? self.errors.empty? end
validate()
click to toggle source
# File lib/joey/location.rb, line 5 def validate valid = true errors << { :message => "country should be string but is #{country.inspect}" } unless country.is_a?(String) errors << { :message => "city should be string but is #{city.inspect}" } unless city.is_a?(String) end