Sha256: d9104b185aab334918a85e85ff3711195299956d8856deebaa919129120458e9

Contents?: true

Size: 718 Bytes

Versions: 17

Compression:

Stored size: 718 Bytes

Contents

module Parliament
  module Decorators
    module ContactPoint
      def postal_addresses
        respond_to?(:contactPointHasPostalAddress) ? contactPointHasPostalAddress : []
      end

      def email
        instance_variable_get('@email'.to_sym).nil? ? '' : instance_variable_get('@email'.to_sym)
      end

      def phone_number
        respond_to?(:phoneNumber) ? phoneNumber : ''
      end

      def fax_number
        respond_to?(:faxNumber) ? faxNumber : ''
      end

      def person
        respond_to?(:contactPointHasPerson) ? contactPointHasPerson : []
      end

      def incumbency
        respond_to?(:contactPointHasIncumbency) ? contactPointHasIncumbency.first : nil
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

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