Module: Freightrain::BindingHost
- Included in:
- FreightView
- Defined in:
- lib/freightrain/binding/binding_host.rb
Instance Method Summary collapse
- #bindings ⇒ Object
- #commit ⇒ Object
- #data_source=(source) ⇒ Object
- #load_bindings_from_file(widgets) ⇒ Object
- #update ⇒ Object
Instance Method Details
#bindings ⇒ Object
21 22 23 |
# File 'lib/freightrain/binding/binding_host.rb', line 21 def bindings return .map { || .bindings }.flatten end |
#commit ⇒ Object
25 26 27 |
# File 'lib/freightrain/binding/binding_host.rb', line 25 def commit bindings.each { |binding| binding.commit } end |
#data_source=(source) ⇒ Object
14 15 16 17 18 19 |
# File 'lib/freightrain/binding/binding_host.rb', line 14 def data_source=(source) bindings.each do |binding| binding.data_source = source binding.update #TODO: is this necessary? end end |
#load_bindings_from_file(widgets) ⇒ Object
6 7 8 9 10 11 12 |
# File 'lib/freightrain/binding/binding_host.rb', line 6 def load_bindings_from_file() loader = BindingLoader.new(self.class.name) loader.each_binding do |, | = .select { || .name == }.first .bind() if end end |
#update ⇒ Object
29 30 31 |
# File 'lib/freightrain/binding/binding_host.rb', line 29 def update bindings.each { |binding| binding.update } end |