Class: ActionView::TemplateDetails::Requested

Inherits:
Object
  • Object
show all
Defined in:
actionview/lib/action_view/template_details.rb

Constant Summary collapse

ANY_HASH =
Hash.new(1).merge(nil => 0).freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(locale:, handlers:, formats:, variants:) ⇒ Requested

Returns a new instance of Requested.


11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'actionview/lib/action_view/template_details.rb', line 11

def initialize(locale:, handlers:, formats:, variants:)
  @locale = locale
  @handlers = handlers
  @formats = formats
  @variants = variants

  @locale_idx   = build_idx_hash(locale)
  @handlers_idx = build_idx_hash(handlers)
  @formats_idx  = build_idx_hash(formats)
  if variants == :any
    @variants_idx = ANY_HASH
  else
    @variants_idx = build_idx_hash(variants)
  end
end

Instance Attribute Details

#formatsObject (readonly)

Returns the value of attribute formats.


6
7
8
# File 'actionview/lib/action_view/template_details.rb', line 6

def formats
  @formats
end

#formats_idxObject (readonly)

Returns the value of attribute formats_idx.


7
8
9
# File 'actionview/lib/action_view/template_details.rb', line 7

def formats_idx
  @formats_idx
end

#handlersObject (readonly)

Returns the value of attribute handlers.


6
7
8
# File 'actionview/lib/action_view/template_details.rb', line 6

def handlers
  @handlers
end

#handlers_idxObject (readonly)

Returns the value of attribute handlers_idx.


7
8
9
# File 'actionview/lib/action_view/template_details.rb', line 7

def handlers_idx
  @handlers_idx
end

#localeObject (readonly)

Returns the value of attribute locale.


6
7
8
# File 'actionview/lib/action_view/template_details.rb', line 6

def locale
  @locale
end

#locale_idxObject (readonly)

Returns the value of attribute locale_idx.


7
8
9
# File 'actionview/lib/action_view/template_details.rb', line 7

def locale_idx
  @locale_idx
end

#variantsObject (readonly)

Returns the value of attribute variants.


6
7
8
# File 'actionview/lib/action_view/template_details.rb', line 6

def variants
  @variants
end

#variants_idxObject (readonly)

Returns the value of attribute variants_idx.


7
8
9
# File 'actionview/lib/action_view/template_details.rb', line 7

def variants_idx
  @variants_idx
end