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.
249 250 251 |
# File 'lib/open_ehr/assumed_library_types.rb', line 249 def fractional_second @fractional_second end |
#hour ⇒ Object
Returns the value of attribute hour.
249 250 251 |
# File 'lib/open_ehr/assumed_library_types.rb', line 249 def hour @hour end |
#minute ⇒ Object
Returns the value of attribute minute.
249 250 251 |
# File 'lib/open_ehr/assumed_library_types.rb', line 249 def minute @minute end |
#second ⇒ Object
Returns the value of attribute second.
249 250 251 |
# File 'lib/open_ehr/assumed_library_types.rb', line 249 def second @second end |
#timezone ⇒ Object
Returns the value of attribute timezone.
249 250 251 |
# File 'lib/open_ehr/assumed_library_types.rb', line 249 def timezone @timezone end |
Instance Method Details
#as_string ⇒ Object
315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
# File 'lib/open_ehr/assumed_library_types.rb', line 315 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
287 288 289 |
# File 'lib/open_ehr/assumed_library_types.rb', line 287 def has_fractional_second? return !@fractional_second.nil? end |
#is_decimal_sign_comma? ⇒ Boolean
303 304 305 |
# File 'lib/open_ehr/assumed_library_types.rb', line 303 def is_decimal_sign_comma? false end |
#is_extended? ⇒ Boolean
307 308 309 |
# File 'lib/open_ehr/assumed_library_types.rb', line 307 def is_extended? true end |
#is_partial? ⇒ Boolean
311 312 313 |
# File 'lib/open_ehr/assumed_library_types.rb', line 311 def is_partial? second_unknown? or minute_unknown? end |
#minute_unknown? ⇒ Boolean
258 259 260 |
# File 'lib/open_ehr/assumed_library_types.rb', line 258 def minute_unknown? @minute.nil? end |
#second_unknown? ⇒ Boolean
267 268 269 |
# File 'lib/open_ehr/assumed_library_types.rb', line 267 def second_unknown? @second.nil? end |
#to_second ⇒ Object
332 333 334 335 336 337 |
# File 'lib/open_ehr/assumed_library_types.rb', line 332 def to_second second = (nilthenzero(@hour)*60 + nilthenzero(@minute))*60 + nilthenzero(@second) + nilthenzero(@fractional_second) return second end |