Ignore:
Timestamp:
Aug 28, 2009, 11:58:05 AM (15 years ago)
Author:
KOBAYASHI, Shinji
Message:

completed uri package

File:
1 edited

Legend:

Unmodified
Added
Removed
  • ruby/branches/0.5/lib/open_ehr/rm/data_types/uri.rb

    r232 r240  
    66
    77module URI
    8   class Ehr < ::URI::Generic
     8  class EHR < ::URI::Generic
    99    COMPONENT = [
    1010      :scheme, :path, :fragment, :query
     
    2424    end
    2525  end
    26   @@schemes['EHR'] = Ehr
     26  @@schemes['EHR'] = EHR
    2727end
    2828
     
    3232      module Uri
    3333        class DvUri < OpenEHR::RM::DataTypes::Basic::DataValue
    34           attr_reader :value
    35 
    36           def initialize(args ={})
     34          def initialize(args = {})
    3735            self.value = args[:value]
    3836          end
    3937
     38          def value
     39            @value.to_s
     40          end
     41
    4042          def fragment_id
    41             @uri.fragment
     43            @value.fragment
    4244          end
    4345
    4446          def path
    45             @uri.path
     47            @value.path
    4648          end
    4749
    4850          def query
    49             @uri.query
     51            @value.query
    5052          end
    5153
    5254          def scheme
    53             @uri.scheme
     55            @value.scheme
    5456          end
    5557
     
    5759            raise ArgumentError, "value is empty" if value.nil?
    5860            parse(value)
    59             @value = value
    6061          end
    6162
     
    6364
    6465          def parse(value)
    65             @uri = ::URI.parse(value)
     66            @value = ::URI.parse(value)
    6667          end
    6768        end
     
    7475          def value=(value)
    7576            raise ArgumentError, "scheme must be ehr" if !(value =~ /^ehr/i)
    76             super(value)
     77            @value = parse(value)
    7778          end
    7879        end # of DV_EHR_URI
Note: See TracChangeset for help on using the changeset viewer.