Module: Espresso::View

Extended by:
Concern
Included in:
ActionView::Base, Haml::Buffer
Defined in:
lib/espresso/view.rb,
lib/espresso/view/has_scope.rb,
lib/espresso/view/searchlogic.rb,
lib/espresso/view/form_builder.rb,
lib/espresso/view/will_paginate.rb,
lib/espresso/view/inherited_resources.rb

Defined Under Namespace

Modules: ClassMethods, InstanceMethods Classes: FormBuilder

Class Method Summary collapse

Methods included from Concern

append_features, extended, included

Class Method Details

.block_classes(main_class, modifiers = [], options = {}) ⇒ Object

Generic espresso block classes

Parameters:

  • main_class (String, Symbol)

    main block class

  • modifiers (Array) (defaults to: [])

    array of modifiers for main block class

  • options (Hash) (defaults to: {})

    another options

Options Hash (options):

  • :type (String) — default: Espresso::View.block_prefix

    type of the block



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/espresso/view.rb', line 18

def self.block_classes(main_class, modifiers = [], options = {})
  options ||= {}
  options[:type] ||= Espresso::View.block_prefix

  main_class = "#{options[:type]}-#{main_class}"
  [main_class].tap do |classes|
    modifiers.each do |modifier|
      classes << "#{main_class}_#{modifier}"
    end
  end.join(' ')
end