Class: CaptainHoog::HelperTable
- Inherits:
-
Array
- Object
- Array
- CaptainHoog::HelperTable
- Defined in:
- lib/captain_hoog/helper_table.rb
Instance Method Summary collapse
- #[](helper_name) ⇒ Object (also: #get)
- #defined_helpers ⇒ Object
- #helper_defined?(helper_name) ⇒ Boolean
- #set(helper) ⇒ Object
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_helpers ⇒ Object
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
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 |