Class: Vines::Backdoor::Gap

Inherits:
Object
  • Object
show all
Defined in:
lib/vines/backdoor/gap.rb

Constant Summary collapse

BACKDOOR =
"backdoor".freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(stream) ⇒ Gap

Returns a new instance of Gap.



11
12
13
# File 'lib/vines/backdoor/gap.rb', line 11

def initialize(stream)
  @stream = stream
end

Instance Attribute Details

#streamObject (readonly)

Returns the value of attribute stream.



9
10
11
# File 'lib/vines/backdoor/gap.rb', line 9

def stream
  @stream
end

Instance Method Details

#node(node) ⇒ Object

Raises:

  • (StreamErrors::NotAuthorized)


15
16
17
18
19
20
21
22
23
# File 'lib/vines/backdoor/gap.rb', line 15

def node(node)
  raise StreamErrors::NotAuthorized unless backdoor?(node)

  stream.start_session(node)
  Backdoor::Auth.new(stream).auth(node)
  Backdoor::Bind.new(stream).bind(node)

  advance(node)
end