Top Level Namespace

Defined Under Namespace

Modules: Acu

Instance Method Summary collapse

Instance Method Details

#acu_as(*symbol) ⇒ Object



13
14
15
# File 'lib/acu/helpers/helpers.rb', line 13

def acu_as *symbol
  yield if acu_is? symbol
end

#acu_except(*symbol) ⇒ Object



17
18
19
# File 'lib/acu/helpers/helpers.rb', line 17

def acu_except *symbol
  yield if not acu_is? symbol
end

#acu_is?(*symbol) ⇒ Boolean

Returns:

  • (Boolean)


1
2
3
4
5
6
7
8
9
10
11
# File 'lib/acu/helpers/helpers.rb', line 1

def acu_is? *symbol
  flag = false
  [symbol].flatten.each do |s| 
  	if s.to_s =~ /\Anot_/
			flag |= not(Acu::Monitor.valid_for?(s.to_s.gsub(/\Anot_/, "").to_sym))
		else
			flag |= Acu::Monitor.valid_for? s 
		end
  end
  flag
end