Module: XMLable::Mixins::NamespaceDefinitionsStorage::ClassMethods

Defined in:
lib/xmlable/mixins/namespace_definitions_storage.rb

Instance Method Summary collapse

Instance Method Details

#__default_namespaceSymbol?

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Default namespace prefix

Returns:

  • (Symbol, nil)


77
78
79
# File 'lib/xmlable/mixins/namespace_definitions_storage.rb', line 77

def __default_namespace
  @__default_namespace
end

#__default_namespace=(val) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Set default namespace prefix

Parameters:

  • (Symbol, nil)


88
89
90
# File 'lib/xmlable/mixins/namespace_definitions_storage.rb', line 88

def __default_namespace=(val)
  @__default_namespace = val
end

#__namespace_definitionsXMLable::Handlers::Storage

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Get namespace definition handlers



99
100
101
# File 'lib/xmlable/mixins/namespace_definitions_storage.rb', line 99

def __namespace_definitions
  @__namespace_definitions ||= []
end

#namespace(*args) ⇒ Object

Define XML namespace

See Also:

  • Handlers::Base#build


62
63
64
65
66
67
68
# File 'lib/xmlable/mixins/namespace_definitions_storage.rb', line 62

def namespace(*args)
  opts = args.last.is_a?(Hash) ? args.pop : {}
  default = opts.delete(:default) || true
  h = Handlers::Namespace.new(*args, opts)
  self.__default_namespace = h.prefix if default
  __namespace_definitions << h
end