Class: Freightrain::FreightElementViewModel
Overview
TODO: make this an extension
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
classes, container_options, extended, inherited, subclasses
#bootstrap, #dialog, #hide, new, #show, #view
extended, #service
Methods included from RegionHost
extended, #region
Methods included from SignalHost
extended, #signal
Constructor Details
Returns a new instance of FreightElementViewModel.
32
33
34
35
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 32
def initialize
super
@signals[:selected] = FreightSignal.new
end
|
Instance Attribute Details
#selected ⇒ Object
Returns the value of attribute selected.
8
9
10
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 8
def selected
@selected
end
|
Class Method Details
.container_options ⇒ Object
10
11
12
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 10
def self.container_options
return { :model => :prototype }
end
|
Instance Method Details
#control ⇒ Object
28
29
30
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 28
def control
return @view.control
end
|
#on_selected ⇒ Object
23
24
25
26
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 23
def on_selected
fire :selected, @value
@view.update
end
|
#set_selection(bool) ⇒ Object
37
38
39
40
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 37
def set_selection(bool)
@selected = bool
@view.update
end
|
#value ⇒ Object
19
20
21
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 19
def value
return @value
end
|
#value=(val) ⇒ Object
14
15
16
17
|
# File 'lib/freightrain/elements/freight_element_view_model.rb', line 14
def value=(val)
@value = val
@view.update
end
|