Module: Psc
- Defined in:
- lib/psc.rb,
lib/psc/client.rb,
lib/psc/version.rb,
lib/psc/connection.rb,
lib/psc/faraday/psc_token.rb,
lib/psc/faraday/string_is_xml.rb,
lib/psc/faraday/accept_psc_types.rb
Overview
The namespace for psc.rb
.
Defined Under Namespace
Modules: Faraday Classes: Client, Connection
Constant Summary collapse
- VERSION =
'0.1.0'
Class Method Summary collapse
-
.xml(root_name, root_attributes = {}, &block) ⇒ String
Wraps
Builder::XmlMarkup
to ease the construction of PSC XML entities. -
.xml_namespace ⇒ Hash<String, String>
Provides an XML namespace mapping suitable for use with Nokogiri.
Class Method Details
.xml(root_name, root_attributes = {}, &block) ⇒ String
Wraps Builder::XmlMarkup
to ease the construction of PSC XML
entities. For example:
Psc.xml('study-snapshot', :assigned_identifier => 'YUV 1234') do |snap|
snap.tag!('long-title', 'Why you validly counting?')
snap.tag!('planned-calendar') { |pc|
pc.epoch(:name => 'Run-in') { |e|
# and so on
}
}
snap.sources { |sources|
sources.source { |src|
# and so on
}
}
}
30 31 32 33 |
# File 'lib/psc.rb', line 30 def self.xml(root_name, root_attributes={}, &block) root_attributes['xmlns'] = xml_namespace['psc'] Builder::XmlMarkup.new(:indent => 2).tag!(root_name, root_attributes, &block) end |
.xml_namespace ⇒ Hash<String, String>
Provides an XML namespace mapping suitable for use with
Nokogiri. The prefix psc
is mapped to PSC's namespace.
44 45 46 |
# File 'lib/psc.rb', line 44 def self.xml_namespace XML_NAMESPACE end |