Class: RubyXL::StringNodeW3C

Inherits:
OOXMLObject show all
Defined in:
lib/rubyXL/objects/container_nodes.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from OOXMLObjectInstanceMethods

#==, #before_write_xml, included, #index_in_collection, #initialize, #write_xml

Class Method Details

.default(v) ⇒ Object



46
47
48
# File 'lib/rubyXL/objects/container_nodes.rb', line 46

def self.default(v)
  v && self.new(:value => v.to_datetime.iso8601)
end

Instance Method Details

#to_timeObject



42
43
44
# File 'lib/rubyXL/objects/container_nodes.rb', line 42

def to_time
  value && (value.strip.empty? ? nil : DateTime.parse(value).to_time)
end