Class: HealthVault::WCData::Thing::Emotion::Emotion

Inherits:
ComplexType
  • Object
show all
Defined in:
lib/wc_data/generated/thing/emotion/emotion.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

#initializeEmotion

Returns a new instance of Emotion.



77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 77

def initialize
  super
  self.tag_name = 'emotion'

  
  @children['when'] = {:name => 'when', :class => HealthVault::WCData::Dates::Datetime, :value => nil, :min => 1, :max => 1, :order => 1, :place => :element, :choice => 0 }
    
  @children['when'][:value] = HealthVault::WCData::Dates::Datetime.new
    
  

  
  @children['mood'] = {:name => 'mood', :class => HealthVault::WCData::Thing::Types::Onetofive, :value => nil, :min => 0, :max => 1, :order => 2, :place => :element, :choice => 0 }
    
  

  
  @children['stress'] = {:name => 'stress', :class => HealthVault::WCData::Thing::Types::Onetofive, :value => nil, :min => 0, :max => 1, :order => 3, :place => :element, :choice => 0 }
    
  

  
  @children['wellbeing'] = {:name => 'wellbeing', :class => HealthVault::WCData::Thing::Types::Onetofive, :value => nil, :min => 0, :max => 1, :order => 4, :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

#moodObject

returns: a HealthVault::WCData::Thing::Types::Onetofive



41
42
43
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 41

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

#mood=(value) ⇒ Object

remarks: The value ranges from one to five, with one being sad and five being very happy. value is a HealthVault::WCData::Thing::Types::Onetofive



36
37
38
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 36

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

#stressObject

returns: a HealthVault::WCData::Thing::Types::Onetofive



56
57
58
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 56

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

#stress=(value) ⇒ Object

remarks: The value ranges from one to five, with one being relaxed to five being stressed. value is a HealthVault::WCData::Thing::Types::Onetofive



51
52
53
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 51

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

#wellbeingObject

returns: a HealthVault::WCData::Thing::Types::Onetofive



71
72
73
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 71

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

#wellbeing=(value) ⇒ Object

remarks: The value ranges from one to five, with one being sick to five being healthy. value is a HealthVault::WCData::Thing::Types::Onetofive



66
67
68
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 66

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

#whenObject

returns: a HealthVault::WCData::Dates::Datetime



26
27
28
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 26

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

#when=(value) ⇒ Object

value is a HealthVault::WCData::Dates::Datetime



21
22
23
# File 'lib/wc_data/generated/thing/emotion/emotion.rb', line 21

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