Class: Ixtlan::Babel::FilterConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/ixtlan/babel/filter_config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#rootObject

Returns the value of attribute root.



68
69
70
# File 'lib/ixtlan/babel/filter_config.rb', line 68

def root
  @root
end

Instance Method Details

#[](key) ⇒ Object



56
57
58
# File 'lib/ixtlan/babel/filter_config.rb', line 56

def []( key )
  context[ key.to_sym ] if key
end

#[]=(key, options) ⇒ Object



52
53
54
# File 'lib/ixtlan/babel/filter_config.rb', line 52

def []=( key, options )
  context[ key.to_sym ] = options if key
end

#collection_options(context_or_options) ⇒ Object



64
65
66
# File 'lib/ixtlan/babel/filter_config.rb', line 64

def collection_options( context_or_options )
  context_options( context_or_options ) || context[ default_context_key[ 1 ] ] || {}
end

#default_context_key(single = :single, collection = :collection) ⇒ Object



47
48
49
50
# File 'lib/ixtlan/babel/filter_config.rb', line 47

def default_context_key( single = :single, 
                         collection = :collection )
  @single, @collection = single, collection
end

#single_options(context_or_options) ⇒ Object



60
61
62
# File 'lib/ixtlan/babel/filter_config.rb', line 60

def single_options( context_or_options )
  context_options( context_or_options ) || context[ default_context_key[ 0 ] ] || {}
end