Class: Ducktape::BindingSource

Inherits:
Object
  • Object
show all
Defined in:
lib/ducktape/binding_source.rb

Constant Summary collapse

PROPAGATE_TO_TARGET =
[:forward, :both].freeze
PROPAGATE_TO_SOURCE =
[:reverse, :both].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source, path, mode = :both, converter = Converter) ⇒ BindingSource

Returns a new instance of BindingSource.



11
12
13
14
# File 'lib/ducktape/binding_source.rb', line 11

def initialize(source, path, mode = :both, converter = Converter)
  @source, @path, @mode = source, path, mode
  @converter = make_converter(converter)
end

Instance Attribute Details

#converterObject (readonly)

Bindable | Object



6
7
8
# File 'lib/ducktape/binding_source.rb', line 6

def converter
  @converter
end

#modeObject (readonly)

Bindable | Object



6
7
8
# File 'lib/ducktape/binding_source.rb', line 6

def mode
  @mode
end

#pathObject (readonly)

Bindable | Object



6
7
8
# File 'lib/ducktape/binding_source.rb', line 6

def path
  @path
end

#sourceObject (readonly)

Bindable | Object



6
7
8
# File 'lib/ducktape/binding_source.rb', line 6

def source
  @source
end

Instance Method Details

#forward?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/ducktape/binding_source.rb', line 16

def forward?
  PROPAGATE_TO_TARGET.include?(@mode)
end

#reverse?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/ducktape/binding_source.rb', line 20

def reverse?
  PROPAGATE_TO_SOURCE.include?(@mode)
end