Class: Rjax::Resolver

Inherits:
Struct
  • Object
show all
Defined in:
lib/rjax/resolver.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#controllerObject

Returns the value of attribute controller

Returns:

  • (Object)

    the current value of controller



3
4
5
# File 'lib/rjax/resolver.rb', line 3

def controller
  @controller
end

#optionsObject

Returns the value of attribute options

Returns:

  • (Object)

    the current value of options



3
4
5
# File 'lib/rjax/resolver.rb', line 3

def options
  @options
end

Class Method Details

.process(*args) ⇒ Object



4
5
6
# File 'lib/rjax/resolver.rb', line 4

def self.process(*args)
  new(*args).process
end

Instance Method Details

#processObject



8
9
10
11
12
13
14
15
16
# File 'lib/rjax/resolver.rb', line 8

def process
  case options
  when Hash     then general_partial
  when Array    then collection_partial
  when NilClass then template_name
  else
    instance_partial
  end
end