Module: Undies

Defined in:
lib/undies.rb,
lib/undies/io.rb,
lib/undies/api.rb,
lib/undies/raw.rb,
lib/undies/source.rb,
lib/undies/element.rb,
lib/undies/version.rb,
lib/undies/template.rb,
lib/undies/root_node.rb,
lib/undies/element_node.rb

Defined Under Namespace

Modules: API, Element Classes: ElementAPIError, ElementNode, IO, NamedSource, Raw, RootAPIError, RootNode, Source, SourceStack, Template

Constant Summary collapse

VERSION =
"3.1.0"

Class Method Summary collapse

Class Method Details

.named_source(name, *args, &block) ⇒ Object



108
109
110
111
112
113
114
# File 'lib/undies/source.rb', line 108

def self.named_source(name, *args, &block)
  if args.empty? && block.nil?
    self.named_sources[name]
  else
    self.named_sources[name] = Undies::NamedSource.new(*args, &block)
  end
end

.named_sourcesObject

singleton accessors for named sources



104
105
106
# File 'lib/undies/source.rb', line 104

def self.named_sources
  @@sources ||= {}
end

.source(name) ⇒ Object



116
117
118
119
120
# File 'lib/undies/source.rb', line 116

def self.source(name)
  if ns = self.named_source(name)
    Undies::Source.new(ns)
  end
end