Class: CaptainHoog::HelperTable

Inherits:
Array
  • Object
show all
Defined in:
lib/captain_hoog/helper_table.rb

Instance Method Summary collapse

Instance Method Details

#[](helper_name) ⇒ Object Also known as: get



12
13
14
15
16
# File 'lib/captain_hoog/helper_table.rb', line 12

def [](helper_name)
  self.detect do |helper|
    helper.keys.include?(helper_name)
  end
end

#defined_helpersObject



8
9
10
# File 'lib/captain_hoog/helper_table.rb', line 8

def defined_helpers
  self.map(&:keys).flatten
end

#helper_defined?(helper_name) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/captain_hoog/helper_table.rb', line 4

def helper_defined?(helper_name)
  defined_helpers.include?(helper_name)
end

#set(helper) ⇒ Object



19
20
21
# File 'lib/captain_hoog/helper_table.rb', line 19

def set(helper)
  self << helper
end