Class: HealthVault::WCData::Thing::Types::Codablevalue

Inherits:
ComplexType
  • Object
show all
Defined in:
lib/wc_data/generated/thing/types/codable_value.rb

Instance Attribute Summary

Attributes inherited from ComplexType

#tag_name

Instance Method Summary collapse

Methods inherited from ComplexType

#add_new_to_children, #element, #method_missing, #optional_elements, #parse_element, #query_elements, #required_elements, #to_s, #valid?

Constructor Details

#initializeCodablevalue

Returns a new instance of Codablevalue.



53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/wc_data/generated/thing/types/codable_value.rb', line 53

def initialize
  super
  self.tag_name = 'codable-value'

  
  @children['text'] = {:name => 'text', :class => String, :value => nil, :min => 1, :max => 1, :order => 1, :place => :element, :choice => 0 }
    
  @children['text'][:value] = String.new
    
  

  
  @children['code'] = {:name => 'code', :class => HealthVault::WCData::Thing::Types::Codedvalue, :value => Array.new, :min => 0, :max => 999999, :order => 2, :place => :element, :choice => 0 }
  

end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class HealthVault::WCData::ComplexType

Instance Method Details

#add_code(value) ⇒ Object

value is a HealthVault::WCData::Thing::Types::Codedvalue



34
35
36
# File 'lib/wc_data/generated/thing/types/codable_value.rb', line 34

def add_code(value)
  @children['code'][:value] << value
end

#codeObject

remarks: Some values can be represented by codes in more that one vocabulary. If appropriate add coded-values from as many vocabularies as are relevant. returns: a HealthVault::WCData::Thing::Types::Codedvalue Array



47
48
49
# File 'lib/wc_data/generated/thing/types/codable_value.rb', line 47

def code
  return @children['code'][:value]
end

#remove_code(value) ⇒ Object

value is a #HealthVault::WCData::Thing::Types::Codedvalue



39
40
41
# File 'lib/wc_data/generated/thing/types/codable_value.rb', line 39

def remove_code(value)
    @children['code'][:value].delete(value)
end

#textObject

returns: a String



27
28
29
# File 'lib/wc_data/generated/thing/types/codable_value.rb', line 27

def text
  return @children['text'][:value]
end

#text=(value) ⇒ Object

remarks: This may be the display value from one of the coded-values or it may be the user entered value. value is a String



22
23
24
# File 'lib/wc_data/generated/thing/types/codable_value.rb', line 22

def text=(value)
  @children['text'][:value] = value
end