Sha256: 35048c72d0d77e922a562d8e9807edb81c00538cf8ab638ab0a8237564f528b7

Contents?: true

Size: 713 Bytes

Versions: 3

Compression:

Stored size: 713 Bytes

Contents

module KirguduBase
	module Concerns::Models::PersonFullName
		extend ActiveSupport::Concern

		included do
		end


		def full_name
			fn = if self.respond_to?(:first_name)
				     self.first_name.to_s
				 elsif self.respond_to?(:firstname)
					 self.firstname
				 else
					 ""
				 end rescue ""

			ln = if self.respond_to?(:last_name)
				     self.last_name.to_s
				 elsif self.respond_to?(:lastname)
					 self.lastname.to_s
				 else
					 ""
				 end rescue ""

			mn = if self.respond_to?(:middle_name)
				     self.middle_name.to_s
				 elsif self.respond_to?(:middlename)
					 self.middlename.to_s
				 else
					 ""
				 end rescue ""

			"#{ln} #{fn} #{mn}".strip  rescue ""
		end


	end
end


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
kirgudu_base-0.0.25 app/models/kirgudu_base/concerns/models/person_full_name.rb
kirgudu_base-0.0.23 app/models/kirgudu_base/concerns/models/person_full_name.rb
kirgudu_base-0.0.22 app/models/kirgudu_base/concerns/models/person_full_name.rb