Class: Jekyll::JekyllRdf::Types::XsdDecimal

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/types/XsdDecimal.rb

Constant Summary collapse

@@class_uri =
"http://www.w3.org/2001/XMLSchema#decimal"

Class Method Summary collapse

Class Method Details

.===(other) ⇒ Object



20
21
22
# File 'lib/jekyll/types/XsdDecimal.rb', line 20

def self.=== other
  return other.to_s.eql? @@class_uri
end

.match?(string) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/jekyll/types/XsdDecimal.rb', line 7

def self.match? string
  return regex.match string
end

.regexObject



11
12
13
14
# File 'lib/jekyll/types/XsdDecimal.rb', line 11

def self.regex
  @@regex ||= /^[+-]?[0-9]*\.[0-9]+$/
  return @@regex
end

.to_sObject



24
25
26
# File 'lib/jekyll/types/XsdDecimal.rb', line 24

def self.to_s
  return @@class_uri
end

.to_type(string) ⇒ Object



16
17
18
# File 'lib/jekyll/types/XsdDecimal.rb', line 16

def self.to_type string
  return string.to_f.to_s
end