Module: Graft::HookPoint::Prepend

Defined in:
lib/graft/hook_point.rb

Instance Method Summary collapse

Instance Method Details

#disable(key) ⇒ Object



180
181
182
# File 'lib/graft/hook_point.rb', line 180

def disable(key)
  unoverride(key)
end

#disabled?(key) ⇒ Boolean

Returns:

  • (Boolean)


184
185
186
# File 'lib/graft/hook_point.rb', line 184

def disabled?(key)
  !overridden?(key)
end

#enable(key) ⇒ Object

Raises:



176
177
178
# File 'lib/graft/hook_point.rb', line 176

def enable(key)
  raise HookPointError, "enable(#{key.inspect}) with prepend strategy"
end

#install(key, &block) ⇒ Object



167
168
169
170
# File 'lib/graft/hook_point.rb', line 167

def install(key, &block)
  prepend(key)
  override(key, &block)
end

#installed?(key) ⇒ Boolean

Returns:

  • (Boolean)


163
164
165
# File 'lib/graft/hook_point.rb', line 163

def installed?(key)
  prepended?(key) && overridden?(key)
end

#uninstall(key) ⇒ Object



172
173
174
# File 'lib/graft/hook_point.rb', line 172

def uninstall(key)
  unoverride(key) if overridden?(key)
end