Module: Ruuuby::Feature::Includable::StringF26

Included in:
String
Defined in:
lib/ruuuby/class/str/str.rb

Overview

defines the operations needed to support Feature(f26) that are applied to Class(String)

Instance Method Summary collapse

Instance Method Details

#as_iso8601String

Returns a normalized representation of iso8601.

Raises:

  • (RuntimeError)

    if this contents of this String are not representative of an iso8601 formatted date and/or time



247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
# File 'lib/ruuuby/class/str/str.rb', line 247

def as_iso8601
  

#iso8601?Boolean



242
# File 'lib/ruuuby/class/str/str.rb', line 242

def iso8601? ; self.length > 3 && self.match?(::String.syntax_iso8601_normalizable) ; end

#to_iso8601DateTime

Raises:

  • (RuntimeError)


279
280
281
282
# File 'lib/ruuuby/class/str/str.rb', line 279

def to_iso8601
  ::DateTime.iso8601(self.as_iso8601)
  #DateTime.strptime(self, '%FT%T%:z')
end