lib/rdf/xsd/duration.rb
def to_s
      @string ||= begin
        str = @object[:si] == '-' ? "-P" : "P"
        str << "%dY" % @object[:yr].to_i if @object[:yr]
        str << "%dM" % @object[:mo].to_i if @object[:mo]
        str << "%dD" % @object[:da].to_i if @object[:da]
        str << "T" if @object[:hr] || @object[:mi] || @object[:se]
        str << "%dH" % @object[:hr].to_i if @object[:hr]
        str << "%dM" % @object[:mi].to_i if @object[:mi]
        str << "#{sec_str}S" if @object[:se]
      end
    end
##
# Returns the value as a string.
#
# @return [String]
Returns the value as a string.
Returns the value as a string .
def to_s
      @string ||= begin
        str = @object[:si] == '-' ? "-P" : "P"
        str << "%dY" % @object[:yr].to_i if @object[:yr]
        str << "%dM" % @object[:mo].to_i if @object[:mo]
        str << "%dD" % @object[:da].to_i if @object[:da]
        str << "T" if @object[:hr] || @object[:mi] || @object[:se]
        str << "%dH" % @object[:hr].to_i if @object[:hr]
        str << "%dM" % @object[:mi].to_i if @object[:mi]
        str << "#{sec_str}S" if @object[:se]
      end
    end
def to_s @string ||= begin str = @object [ :si ] == '-' ? "-P" : "P" str << "%dY" % @object [ :yr ] . to_i if @object [ :yr ] str << "%dM" % @object [ :mo ] . to_i if @object [ :mo ] str << "%dD" % @object [ :da ] . to_i if @object [ :da ] str << "T" if @object [ :hr ] || @object [ :mi ] || @object [ :se ] str << "%dH" % @object [ :hr ] . to_i if @object [ :hr ] str << "%dM" % @object [ :mi ] . to_i if @object [ :mi ] str << "#{sec_str}S" if @object [ :se ] end end
Returns the value as a string.
Returns the value as a string .
None
String