Module: PageletRails::Concerns::Options::Shared

Included in:
ClassMethods
Defined in:
lib/pagelet_rails/concerns/options.rb

Instance Method Summary collapse

Instance Method Details

#set_pagelet_options(*args) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/pagelet_rails/concerns/options.rb', line 30

def set_pagelet_options *args
  opts = args.extract_options!
  actions = args
  actions << 'default' if actions.blank?

  @pagelet_options ||= {}.with_indifferent_access

  if opts.any?
    actions.each do |action|
      @pagelet_options.deep_merge! action => opts
    end
  end
  @pagelet_options
end