Included Modules

Files

Class Index [+]

Quicksearch

XSD::XSDGYear

Constants

Type

Public Class Methods

new(value = nil) click to toggle source
     # File lib/xsd/datatypes.rb, line 782
782:   def initialize(value = nil)
783:     init(Type, value)
784:   end

Private Instance Methods

_to_s() click to toggle source
     # File lib/xsd/datatypes.rb, line 801
801:   def _to_s
802:     year = (@data.year > 0) ? @data.year : @data.year - 1
803:     s = format('%.4d', year)
804:     add_tz(s)
805:   end
screen_data_str(t) click to toggle source
     # File lib/xsd/datatypes.rb, line 788
788:   def screen_data_str(t)
789:     /^([+\-]?\d{4,})(Z|(?:([+\-])(\d\d):(\d\d))?)?$/ =~ t.to_s.strip
790:     unless Regexp.last_match
791:       raise ValueSpaceError.new("#{ type }: cannot accept '#{ t }'.")
792:     end
793:     year = $1.to_i
794:     if year < 0
795:       year += 1
796:     end
797:     zonestr = $2
798:     DateTime.civil(year, 1, 1, 0, 0, 0, tz2of(zonestr))
799:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.