Module: OpenEHR::AssumedLibraryTypes::ISO8601TimeModule
- Includes:
- TimeDefinitions
- Included in:
- ISO8601DateTimeModule, ISO8601Time
- Defined in:
- lib/open_ehr/assumed_library_types.rb
Overview
end of ISO8601_DATE
Constant Summary
Constants included from TimeDefinitions
TimeDefinitions::DAYS_IN_LEAP_YEAR, TimeDefinitions::DAYS_IN_WEEK, TimeDefinitions::DAYS_IN_YEAR, TimeDefinitions::HOURS_IN_DAY, TimeDefinitions::MAX_DAYS_IN_MONTH, TimeDefinitions::MAX_DAYS_IN_YEAR, TimeDefinitions::MINUTES_IN_HOUR, TimeDefinitions::MONTH_IN_YEAR, TimeDefinitions::NOMINAL_DAYS_IN_MONTH, TimeDefinitions::NOMINAL_DAYS_IN_YEAR, TimeDefinitions::SECONDS_IN_MINUTE
Instance Attribute Summary collapse
-
#fractional_second ⇒ Object
Returns the value of attribute fractional_second.
-
#hour ⇒ Object
Returns the value of attribute hour.
-
#minute ⇒ Object
Returns the value of attribute minute.
-
#second ⇒ Object
Returns the value of attribute second.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
Instance Method Summary collapse
- #as_string ⇒ Object
- #has_fractional_second? ⇒ Boolean
- #is_decimal_sign_comma? ⇒ Boolean
- #is_extended? ⇒ Boolean
- #is_partial? ⇒ Boolean
- #minute_unknown? ⇒ Boolean
- #second_unknown? ⇒ Boolean
- #to_second ⇒ Object
Methods included from TimeDefinitions
valid_day?, valid_hour?, valid_minute?, valid_month?, valid_second?, valid_year?
Instance Attribute Details
#fractional_second ⇒ Object
Returns the value of attribute fractional_second.
244 245 246 |
# File 'lib/open_ehr/assumed_library_types.rb', line 244 def fractional_second @fractional_second end |
#hour ⇒ Object
Returns the value of attribute hour.
244 245 246 |
# File 'lib/open_ehr/assumed_library_types.rb', line 244 def hour @hour end |
#minute ⇒ Object
Returns the value of attribute minute.
244 245 246 |
# File 'lib/open_ehr/assumed_library_types.rb', line 244 def minute @minute end |
#second ⇒ Object
Returns the value of attribute second.
244 245 246 |
# File 'lib/open_ehr/assumed_library_types.rb', line 244 def second @second end |
#timezone ⇒ Object
Returns the value of attribute timezone.
244 245 246 |
# File 'lib/open_ehr/assumed_library_types.rb', line 244 def timezone @timezone end |
Instance Method Details
#as_string ⇒ Object
310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 |
# File 'lib/open_ehr/assumed_library_types.rb', line 310 def as_string s = sprintf("%02d", @hour) if !@minute.nil? s += ":" + sprintf("%02d",@minute) if !@second.nil? s += ":" + sprintf("%02d", @second) if !@fractional_second.nil? s += "." + @fractional_second.to_s[2..-1] if !@timezone.nil? s += @timezone end end end end return s end |
#has_fractional_second? ⇒ Boolean
282 283 284 |
# File 'lib/open_ehr/assumed_library_types.rb', line 282 def has_fractional_second? return !@fractional_second.nil? end |
#is_decimal_sign_comma? ⇒ Boolean
298 299 300 |
# File 'lib/open_ehr/assumed_library_types.rb', line 298 def is_decimal_sign_comma? false end |
#is_extended? ⇒ Boolean
302 303 304 |
# File 'lib/open_ehr/assumed_library_types.rb', line 302 def is_extended? true end |
#is_partial? ⇒ Boolean
306 307 308 |
# File 'lib/open_ehr/assumed_library_types.rb', line 306 def is_partial? second_unknown? or minute_unknown? end |
#minute_unknown? ⇒ Boolean
253 254 255 |
# File 'lib/open_ehr/assumed_library_types.rb', line 253 def minute_unknown? @minute.nil? end |
#second_unknown? ⇒ Boolean
262 263 264 |
# File 'lib/open_ehr/assumed_library_types.rb', line 262 def second_unknown? @second.nil? end |
#to_second ⇒ Object
327 328 329 330 331 332 |
# File 'lib/open_ehr/assumed_library_types.rb', line 327 def to_second second = (nilthenzero(@hour)*60 + nilthenzero(@minute))*60 + nilthenzero(@second) + nilthenzero(@fractional_second) return second end |