Class: SBF::Client::NamePieces

Inherits:
BaseEntity show all
Defined in:
lib/stbaldricks/entities/lib/name.rb

Constant Summary

Constants inherited from BaseEntity

BaseEntity::ELSE

Instance Attribute Summary collapse

Attributes inherited from BaseEntity

#errors

Instance Method Summary collapse

Methods inherited from BaseEntity

#add_errors, allow_instantiation?, attr_accessor, attr_reader, attr_writer, attributes, #attributes=, collection_attributes, entity_attr_accessor, entity_attr_reader, entity_attr_writer, entity_attributes, entity_collection_attr_accessor, entity_collection_attr_reader, entity_collection_attr_writer, inherited, #initialize, #model_name, multitype_attr_accessor, multitype_attr_reader, multitype_attr_writer, multitype_collection_attr_accessor, multitype_collection_attr_reader, multitype_collection_attr_writer, #not_provided_attributes, optional_attributes, #persisted?, #to_hash, #to_json

Constructor Details

This class inherits a constructor from SBF::Client::BaseEntity

Instance Attribute Details

#first_nameObject

Returns the value of attribute first_name.



6
7
8
# File 'lib/stbaldricks/entities/lib/name.rb', line 6

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



6
7
8
# File 'lib/stbaldricks/entities/lib/name.rb', line 6

def last_name
  @last_name
end

#middle_initialObject

Returns the value of attribute middle_initial.



6
7
8
# File 'lib/stbaldricks/entities/lib/name.rb', line 6

def middle_initial
  @middle_initial
end

#prefixObject

Returns the value of attribute prefix.



6
7
8
# File 'lib/stbaldricks/entities/lib/name.rb', line 6

def prefix
  @prefix
end

#suffixObject

Returns the value of attribute suffix.



6
7
8
# File 'lib/stbaldricks/entities/lib/name.rb', line 6

def suffix
  @suffix
end

Instance Method Details

#combined_nameObject



8
9
10
11
12
13
14
# File 'lib/stbaldricks/entities/lib/name.rb', line 8

def combined_name
  name = ''
  name += @first_name + ' ' unless @first_name.nil?
  name += @middle_initial + '. ' unless @middle_initial.nil?
  name += @last_name unless @last_name.nil?
  name.strip
end