Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: d3d26f4bea
Fetching contributors…

Cannot retrieve contributors at this time

53 lines (41 sloc) 1.155 kB
require 'ixtlan/babel/context'
module Ixtlan
module Babel
class FilterConfig
private
def context
@context ||= {}
end
def context_options( context_or_options )
if context_or_options
case context_or_options
when Symbol
if opts = context[ context_or_options ]
opts.dup
end
when Hash
context_or_options
end
end
end
public
def default_context_key( single = :single,
collection = :collection )
@single, @collection = single, collection
end
def []=( key, options )
context[ key.to_sym ] = options if key
end
def []( key )
context[ key.to_sym ] if key
end
def single_options( context_or_options )
context_options( context_or_options ) || (context[default_context_key[0]]) || {}
end
def collection_options( context_or_options )
context_options( context_or_options ) || (context[default_context_key[1]]) || {}
end
attr_accessor :root
end
end
end
Jump to Line
Something went wrong with that request. Please try again.