Class: Location::AddressForm
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
#address_normalizer, #normalizable_address_attributes=
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
31
32
33
|
# File 'app/models/location/address_form.rb', line 31
def address
@address
end
|
Class Method Details
.default_presence_attributes ⇒ Object
12
13
14
|
# File 'app/models/location/address_form.rb', line 12
def self.default_presence_attributes
%i{postal_code street district}
end
|
.float_attributes ⇒ Object
20
21
22
|
# File 'app/models/location/address_form.rb', line 20
def self.float_attributes
%i{latitude longitude}
end
|
.string_attributes ⇒ Object
16
17
18
|
# File 'app/models/location/address_form.rb', line 16
def self.string_attributes
%i{postal_code street number complement district city state}
end
|
Instance Method Details
#validate_presence_of(attributes) ⇒ Object
37
38
39
40
41
42
43
44
|
# File 'app/models/location/address_form.rb', line 37
def validate_presence_of(attributes)
attributes = Array(attributes)
@presence = self.attributes.keys.inject({}) do |hash, attr|
hash[attr] = attributes.include?(attr)
hash
end
end
|