Module: Ohm::LunarMacros::ClassMethods

Defined in:
lib/ohm/contrib/lunar_macros.rb

Instance Method Summary collapse

Instance Method Details

#fuzzy(*atts) ⇒ Object



18
# File 'lib/ohm/contrib/lunar_macros.rb', line 18

def fuzzy(*atts)    lunar_fields(:fuzzy,    *atts) end

#lunar_fields(type, *atts) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/ohm/contrib/lunar_macros.rb', line 23

def lunar_fields(type, *atts)
  @lunar_fields ||= Hash.new { |h, k| h[k] = [] }

  atts.each { |att|
    @lunar_fields[type] << att  unless @lunar_fields[type].include?(att)
  }

  @lunar_fields[type]
end

#number(*atts) ⇒ Object



20
# File 'lib/ohm/contrib/lunar_macros.rb', line 20

def number(*atts)   lunar_fields(:number,   *atts) end

#sortable(*atts) ⇒ Object



21
# File 'lib/ohm/contrib/lunar_macros.rb', line 21

def sortable(*atts) lunar_fields(:sortable, *atts) end

#text(*atts) ⇒ Object



19
# File 'lib/ohm/contrib/lunar_macros.rb', line 19

def text(*atts)     lunar_fields(:text,     *atts) end