lib/hermod/xml_section_builder.rb
def datetime_node(name, options={})
      validators = [].tap do |validators|
        validators << Validators::ValuePresence.new unless options.delete(:optional)
        validators << Validators::TypeChecker.new(DateTime) { |value| value.respond_to? :strftime }
      end

      create_method(name, [], validators, options) do |value, attributes|
        [(value ? value.strftime(format_for(:datetime)) : nil), attributes]
      end
    end
# Public: defines a node for sending a datetime to HMRC
#
# name    - the name of the node. This will become the name of the method on the XmlSection.
# options - a hash of options used to set up validations.
#
# Returns nothing you should rely on
defines a node for sending a datetime to HMRC
name    - the name of the node. This will become the name of the method on the XmlSection.
options - a hash of options used to set up validations.

Returns nothing you should rely on
defines a node for sending a datetime to HMRC name - the name of the node . This will become the name of the method on the XmlSection . options - a hash of options used to set up validations . Returns nothing you should rely on
def datetime_node(name, options={})
      validators = [].tap do |validators|
        validators << Validators::ValuePresence.new unless options.delete(:optional)
        validators << Validators::TypeChecker.new(DateTime) { |value| value.respond_to? :strftime }
      end
      create_method(name, [], validators, options) do |value, attributes|
        [(value ? value.strftime(format_for(:datetime)) : nil), attributes]
      end
    end
def datetime_node ( name , options = { } ) validators = [ ] . tap do | validators | validators << Validators :: ValuePresence . new unless options . delete ( :optional ) validators << Validators :: TypeChecker . new ( DateTime ) { | value | value . respond_to? :strftime } end create_method ( name , [ ] , validators , options ) do | value , attributes | [ ( value ? value . strftime ( format_for ( :datetime ) ) : nil ) , attributes ] end end
Public: defines a node for sending a datetime to HMRC
name    - the name of the node.
Public : defines a node for sending a datetime to HMRC name - the name of the node .
name
options