Class: Location::Finder::Address
- Inherits:
-
Object
- Object
- Location::Finder::Address
- Defined in:
- lib/location/finder.rb
Instance Attribute Summary collapse
-
#city ⇒ Object
Returns the value of attribute city.
-
#complement ⇒ Object
Returns the value of attribute complement.
-
#district ⇒ Object
Returns the value of attribute district.
-
#number ⇒ Object
Returns the value of attribute number.
-
#postal_code ⇒ Object
Returns the value of attribute postal_code.
-
#state ⇒ Object
Returns the value of attribute state.
-
#street ⇒ Object
Returns the value of attribute street.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#city ⇒ Object
Returns the value of attribute city.
38 39 40 |
# File 'lib/location/finder.rb', line 38 def city @city end |
#complement ⇒ Object
Returns the value of attribute complement.
37 38 39 |
# File 'lib/location/finder.rb', line 37 def complement @complement end |
#district ⇒ Object
Returns the value of attribute district.
38 39 40 |
# File 'lib/location/finder.rb', line 38 def district @district end |
#number ⇒ Object
Returns the value of attribute number.
37 38 39 |
# File 'lib/location/finder.rb', line 37 def number @number end |
#postal_code ⇒ Object
Returns the value of attribute postal_code.
36 37 38 |
# File 'lib/location/finder.rb', line 36 def postal_code @postal_code end |
#state ⇒ Object
Returns the value of attribute state.
38 39 40 |
# File 'lib/location/finder.rb', line 38 def state @state end |
#street ⇒ Object
Returns the value of attribute street.
37 38 39 |
# File 'lib/location/finder.rb', line 37 def street @street end |
#type ⇒ Object
Returns the value of attribute type.
36 37 38 |
# File 'lib/location/finder.rb', line 36 def type @type end |
Instance Method Details
#to_hash(options = {}) ⇒ Object
50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/location/finder.rb', line 50 def to_hash( = {}) attributes = instance_variables.map do |k| k.to_s.gsub(/^@/, '').to_sym end only = Array([:only] || attributes).map!(&:to_sym) attributes.each_with_object({}) do |k, a| a[k] = send(k) if only.include?(k) end end |