Sha256: b257556a5a4e00a4939f59cd43b736bcd45e65bf64498c1ad762caaaa3d84465

Contents?: true

Size: 488 Bytes

Versions: 23

Compression:

Stored size: 488 Bytes

Contents

module Parliament
  module Decorators
    module PostalAddress
      def full_address
        address_array.join(', ')
      end

      private

      def address_array
        address_array = []
        (1..5).each do |i|
          if respond_to?("addressLine#{i}".to_sym)
            address_array << instance_variable_get("@addressLine#{i}".to_sym)
          end
        end
        address_array << postCode if respond_to?(:postCode)
        address_array
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
parliament-ruby-0.5.19 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.18 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.17 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.16 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.15 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.14 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.13 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.12 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.8 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.7 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.6 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.5 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.4 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.3 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.2 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.1 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.5.0 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.4.1 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.4.0 lib/parliament/decorators/postal_address.rb
parliament-ruby-0.3.0 lib/parliament/decorators/postal_address.rb