class Gedcomx::NameForm

Attributes

parts[R]

Public Class Methods

create(attributes = {}) click to toggle source
# File lib/gedcomx/name_form.rb, line 10
def self.create(attributes = {})
  new_form = self.new
  new_form.full_text = attributes[:full_text] if attributes[:full_text]
  attributes[:fields].each { |field| new_form.add_field field } if attributes[:fields].is_a? Array
  attributes[:parts].each { |part| new_form.add_part part } if attributes[:parts].is_a? Array
end
java_class() click to toggle source
# File lib/gedcomx/name_form.rb, line 6
def self.java_class
  Java::OrgGedcomxConclusion::NameForm
end
new(input = nil) click to toggle source
# File lib/gedcomx/name_form.rb, line 17
def initialize(input = nil)
  @name_form = input || self.class.java_class.new
  @parts = []
  @parts = @name_form.parts.map { |part| Gedcomx::NamePart.new(part) } if @name_form.parts
end

Public Instance Methods

add_part(part) click to toggle source
# File lib/gedcomx/name_form.rb, line 23
def add_part(part)
  return false unless part.is_a? Gedcomx::NamePart
  @name_form.add_part part.to_java
  @parts << part
end
full_text() click to toggle source
# File lib/gedcomx/name_form.rb, line 29
def full_text
  @name_form.get_full_text
end
full_text=(full_text) click to toggle source
# File lib/gedcomx/name_form.rb, line 33
def full_text=(full_text)
  @name_form.full_text = full_text
end
to_java() click to toggle source
# File lib/gedcomx/name_form.rb, line 37
def to_java
  @name_form
end