Class: Rfm::Metadata::ValueListItem

Inherits:
String
  • Object
show all
Defined in:
lib/rfm/metadata/value_list_item.rb

Overview

The ValueListItem object represents an item in a Filemaker value list. ValueListItem is subclassed from String, so you can use it just like a string. It does have three additional methods to help separate Filemaker value vs display items.

Getting values vs display items:

  • #value the value list item value

  • #display is the value list item display. It could be the same as value, or it could be the “second field”, if that option is checked in Filemaker

  • #value_list_name is the name of the parent value list, if any

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value, display, value_list_name) ⇒ ValueListItem

Returns a new instance of ValueListItem.



20
21
22
23
24
25
# File 'lib/rfm/metadata/value_list_item.rb', line 20

def initialize(value, display, value_list_name)
  @value_list_name = value_list_name
  @value           = value.to_s
  @display         = display.to_s
  self.replace @value
end

Instance Attribute Details

#displayObject (readonly)

Returns the value of attribute display.



18
19
20
# File 'lib/rfm/metadata/value_list_item.rb', line 18

def display
  @display
end

#valueObject (readonly)

Returns the value of attribute value.



18
19
20
# File 'lib/rfm/metadata/value_list_item.rb', line 18

def value
  @value
end

#value_list_nameObject (readonly)

Returns the value of attribute value_list_name.



18
19
20
# File 'lib/rfm/metadata/value_list_item.rb', line 18

def value_list_name
  @value_list_name
end