Module: Gyoku

Defined in:
lib/gyoku.rb,
lib/gyoku/hash.rb,
lib/gyoku/array.rb,
lib/gyoku/version.rb,
lib/gyoku/xml_key.rb,
lib/gyoku/xml_value.rb,
lib/gyoku/core_ext/string.rb

Defined Under Namespace

Modules: CoreExt, XMLKey, XMLValue Classes: Array, Hash

Constant Summary collapse

VERSION =
"0.4.4"

Class Method Summary collapse

Class Method Details

.configure {|_self| ... } ⇒ Object

Yields this object for configuration.

Yields:

  • (_self)

Yield Parameters:

  • _self (Gyoku)

    the object that the method was called on



13
14
15
# File 'lib/gyoku.rb', line 13

def configure
  yield self
end

.convert_symbols_to(formula = nil, &block) ⇒ Object

Sets the formula for converting Symbol keys.



18
19
20
# File 'lib/gyoku.rb', line 18

def convert_symbols_to(formula = nil, &block)
  XMLKey.symbol_converter = formula ? formula : block
end

.xml(hash, options = {}) ⇒ Object

Translates a given hash with options to XML.



8
9
10
# File 'lib/gyoku.rb', line 8

def xml(hash, options = {})
  Hash.to_xml hash.dup, options
end