Class: Appear::Revealers::BaseRevealer

Inherits:
Service show all
Defined in:
lib/appear/revealers.rb

Overview

extend to implement more revealers

Direct Known Subclasses

MacRevealer, Tmux

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseService

delegate, #initialize, require_service, required_services

Constructor Details

This class inherits a constructor from Appear::BaseService

Class Method Details

.register!Object



33
34
35
# File 'lib/appear/revealers.rb', line 33

def self.register!
  Appear::REVEALERS.push(self)
end

Instance Method Details

#call(tree) ⇒ Object



14
15
16
17
18
19
# File 'lib/appear/revealers.rb', line 14

def call(tree)
  target, *rest = tree
  if supports_tree?(target, rest)
    return reveal_tree(tree)
  end
end

#reveal_tree(tree) ⇒ Object

TODO



22
23
24
# File 'lib/appear/revealers.rb', line 22

def reveal_tree(tree)
  raise "not implemented"
end

#supports_tree?(target, rest) ⇒ Boolean

appear the first process in this process tree. should return nil if no action was performed. otherwise, return true.

Returns:

  • (Boolean)


29
30
31
# File 'lib/appear/revealers.rb', line 29

def supports_tree?(target, rest)
  raise "not implemented"
end