Class: ActionView::TemplateDetails::Requested
Relationships & Source Files | |
Inherits: | Object |
Defined in: | actionview/lib/action_view/template_details.rb |
Constant Summary
-
ANY_HASH =
# File 'actionview/lib/action_view/template_details.rb', line 9Hash.new(1).merge(nil => 0).freeze
Class Method Summary
Instance Attribute Summary
- #formats readonly
- #formats_idx readonly
- #handlers readonly
- #handlers_idx readonly
- #locale readonly
- #locale_idx readonly
- #variants readonly
- #variants_idx readonly
Instance Method Summary
- #build_idx_hash(arr) private
Constructor Details
.new(locale:, handlers:, formats:, variants:) ⇒ Requested
# 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
#formats (readonly)
[ GitHub ]#formats_idx (readonly)
[ GitHub ]# File 'actionview/lib/action_view/template_details.rb', line 7
attr_reader :locale_idx, :handlers_idx, :formats_idx, :variants_idx
#handlers (readonly)
[ GitHub ]#handlers_idx (readonly)
[ GitHub ]# File 'actionview/lib/action_view/template_details.rb', line 7
attr_reader :locale_idx, :handlers_idx, :formats_idx, :variants_idx
#locale (readonly)
[ GitHub ]#locale_idx (readonly)
[ GitHub ]# File 'actionview/lib/action_view/template_details.rb', line 7
attr_reader :locale_idx, :handlers_idx, :formats_idx, :variants_idx
#variants (readonly)
[ GitHub ]#variants_idx (readonly)
[ GitHub ]# File 'actionview/lib/action_view/template_details.rb', line 7
attr_reader :locale_idx, :handlers_idx, :formats_idx, :variants_idx
Instance Method Details
#build_idx_hash(arr) (private)
[ GitHub ]# File 'actionview/lib/action_view/template_details.rb', line 28
def build_idx_hash(arr) [*arr, nil].each_with_index.to_h.freeze end