Changeset 79


Ignore:
Timestamp:
Jul 10, 2008, 10:03:47 PM (14 years ago)
Author:
KOBAYASHI, Shinji
Message:

refs #36

Location:
ruby/trunk/lib/models
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ruby/trunk/lib/models/assumed_library_types.rb

    r70 r79  
    156156        true
    157157      end
    158     end # end of ISO_8601_DATE
     158    end # end of ISO8601_DATE
     159
     160    class ISO8601_TIME < TIME_DEFINITIONS
     161
     162    end # end of ISO8601_TIME
     163
     164    class ISO8601_TIMEZONE
     165      attr_accessor :sign, :hour, :minute
     166      def is_gmt?
     167        hour == 0
     168      end
     169      def as_string
     170        sprintf("Z%s%2d%2d", @sign, @hour, @minute)
     171      end
     172    end # end of ISO8601_TIMEZONE
    159173  end # end of Assumed_Types
    160174end # end of OpenEHR
  • ruby/trunk/lib/models/tests/test_assumed_library_types.rb

    r70 r79  
    88    @iso8601_date = OpenEHR::Assumed_Library_Types::ISO8601_DATE.new
    99    @iso8601_time = OpenEHR::Assumed_Library_Types::ISO8601_TIME.new
     10    @iso8601_timezone = OpenEHR::Assumed_Library_Types::ISO8601_TIMEZONE.new
    1011  end
    1112  def test_initialize
     
    1415    assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_DATE, @iso8601_date
    1516    assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_TIME, @iso8601_time
     17    assert_instance_of OpenEHR::Assumed_Library_Types::ISO8601_TIMEZONE, @iso8601_timezone
    1618  end
    1719  def test_limits_comparable
     
    185187
    186188  def test_iso8601_time
    187     assert @iso8601_time.
     189
     190  end
     191  def test_iso8601_timezone
    188192  end
    189193end
Note: See TracChangeset for help on using the changeset viewer.