Class: Gedcomx::FieldValue

Inherits:
Object
  • Object
show all
Defined in:
lib/gedcomx/field_value.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(input = nil) ⇒ FieldValue

Returns a new instance of FieldValue.



8
9
10
# File 'lib/gedcomx/field_value.rb', line 8

def initialize(input = nil)
  @value = input || self.class.java_class.new
end

Class Method Details

.java_classObject



4
5
6
# File 'lib/gedcomx/field_value.rb', line 4

def self.java_class
  Java::OrgGedcomxRecords::FieldValue
end

Instance Method Details

#textObject



12
13
14
# File 'lib/gedcomx/field_value.rb', line 12

def text
  @value.get_text
end

#text=(input_string) ⇒ Object



16
17
18
# File 'lib/gedcomx/field_value.rb', line 16

def text=(input_string)
  @value.text= input_string
end

#to_javaObject



28
29
30
# File 'lib/gedcomx/field_value.rb', line 28

def to_java
  @value
end

#typeObject



20
21
22
# File 'lib/gedcomx/field_value.rb', line 20

def type
  @value.get_type.to_s
end

#type=(input_type) ⇒ Object



24
25
26
# File 'lib/gedcomx/field_value.rb', line 24

def type= (input_type)
  @value.type = ( input_type.is_a? Gedcomx.java_uri_class ) ? input_type : Gedcomx.new_uri(input_type)
end