class Garbanzo::Address
Constants
- ATTRIBUTES
Public Class Methods
new(options = {})
click to toggle source
# File lib/garbanzo/address.rb, line 17 def initialize(options = {}) options.each do |attribute, value| public_send("#{attribute}=", value) end end
Public Instance Methods
to_h()
click to toggle source
# File lib/garbanzo/address.rb, line 27 def to_h ATTRIBUTES.reduce({}) do |hash, attribute| value = public_send(attribute) hash.merge!(attribute => value) if value hash end end
valid?()
click to toggle source
# File lib/garbanzo/address.rb, line 23 def valid? first_name.to_s != '' && last_name.to_s != '' end