Class: Ducktape::BindingSource
- Inherits:
-
Object
- Object
- Ducktape::BindingSource
- 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
-
#converter ⇒ Object
readonly
Bindable | Object.
-
#mode ⇒ Object
readonly
Bindable | Object.
-
#path ⇒ Object
readonly
Bindable | Object.
-
#source ⇒ Object
readonly
Bindable | Object.
Instance Method Summary collapse
- #forward? ⇒ Boolean
-
#initialize(source, path, mode = :both, converter = Converter) ⇒ BindingSource
constructor
A new instance of BindingSource.
- #reverse? ⇒ Boolean
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
#converter ⇒ Object (readonly)
Bindable | Object
6 7 8 |
# File 'lib/ducktape/binding_source.rb', line 6 def converter @converter end |
#mode ⇒ Object (readonly)
Bindable | Object
6 7 8 |
# File 'lib/ducktape/binding_source.rb', line 6 def mode @mode end |
#path ⇒ Object (readonly)
Bindable | Object
6 7 8 |
# File 'lib/ducktape/binding_source.rb', line 6 def path @path end |
#source ⇒ Object (readonly)
Bindable | Object
6 7 8 |
# File 'lib/ducktape/binding_source.rb', line 6 def source @source end |
Instance Method Details
#forward? ⇒ Boolean
16 17 18 |
# File 'lib/ducktape/binding_source.rb', line 16 def forward? PROPAGATE_TO_TARGET.include?(@mode) end |
#reverse? ⇒ Boolean
20 21 22 |
# File 'lib/ducktape/binding_source.rb', line 20 def reverse? PROPAGATE_TO_SOURCE.include?(@mode) end |