Class: Clownfish::Adapter
- Inherits:
-
Object
- Object
- Clownfish::Adapter
- Defined in:
- lib/clownfish/adapter.rb
Overview
Adapter between Anemone and clownfish objects.
Instance Method Summary collapse
-
#anemone_options ⇒ Object
Internal: Forwards Anemone options from clownfish.
-
#hook_into_anemone(anemone) ⇒ Object
Internal: Connects clownfish to Anemone.
-
#initialize(clownfish) ⇒ Adapter
constructor
Internal: Create an Adapter that wraps a clownfish.
Constructor Details
#initialize(clownfish) ⇒ Adapter
Internal: Create an Adapter that wraps a clownfish.
clownfish - Object that conforms to clownfish spec. See README.md.
7 8 9 10 |
# File 'lib/clownfish/adapter.rb', line 7 def initialize(clownfish) raise ArgumentError, "clownfish cannot be nil" if clownfish.nil? @delegate = clownfish end |
Instance Method Details
#anemone_options ⇒ Object
Internal: Forwards Anemone options from clownfish.
Returns Hash of Anemone options, never nil.
15 16 17 |
# File 'lib/clownfish/adapter.rb', line 15 def (@delegate.respond_to?(:anemone_options) && @delegate.) || {} end |
#hook_into_anemone(anemone) ⇒ Object
Internal: Connects clownfish to Anemone.
anemone - Instance of Anemone::Core.
Returns nothing.
24 25 26 27 28 29 |
# File 'lib/clownfish/adapter.rb', line 24 def hook_into_anemone(anemone) wire_up_after_crawl(anemone) wire_up_on_every_page(anemone) wire_up_focus_crawl(anemone) relay_skip_links_like(anemone) end |