Class: Gecko::Widget::Geckometer
- Inherits:
-
Gecko::Widget
- Object
- Gecko::Widget
- Gecko::Widget::Geckometer
- Defined in:
- lib/gecko/graph/geckometer.rb
Defined Under Namespace
Classes: EndPoint
Instance Attribute Summary collapse
-
#max ⇒ Object
readonly
Returns the value of attribute max.
-
#min ⇒ Object
readonly
Returns the value of attribute min.
-
#value ⇒ Object
Returns the value of attribute value.
Attributes inherited from Gecko::Widget
Instance Method Summary collapse
- #data_payload ⇒ Object
-
#initialize(*args, &block) ⇒ Geckometer
constructor
A new instance of Geckometer.
- #max_text=(text) ⇒ Object
- #max_value=(value) ⇒ Object
- #min_text=(text) ⇒ Object
- #min_value=(value) ⇒ Object
Methods inherited from Gecko::Widget
#config, #config!, #on_update, #payload, #push_requests, #push_url, #update
Constructor Details
#initialize(*args, &block) ⇒ Geckometer
Returns a new instance of Geckometer.
8 9 10 11 |
# File 'lib/gecko/graph/geckometer.rb', line 8 def initialize(*args, &block) super @min, @max = EndPoint.new, EndPoint.new end |
Instance Attribute Details
#max ⇒ Object (readonly)
Returns the value of attribute max.
7 8 9 |
# File 'lib/gecko/graph/geckometer.rb', line 7 def max @max end |
#min ⇒ Object (readonly)
Returns the value of attribute min.
7 8 9 |
# File 'lib/gecko/graph/geckometer.rb', line 7 def min @min end |
#value ⇒ Object
Returns the value of attribute value.
6 7 8 |
# File 'lib/gecko/graph/geckometer.rb', line 6 def value @value end |
Instance Method Details
#data_payload ⇒ Object
29 30 31 32 33 34 35 |
# File 'lib/gecko/graph/geckometer.rb', line 29 def data_payload { :item => self.value, :min => {:value => self.min.value, :text => self.min.text}, :max => {:value => self.max.value, :text => self.max.text} } end |
#max_text=(text) ⇒ Object
25 26 27 |
# File 'lib/gecko/graph/geckometer.rb', line 25 def max_text=(text) self.max.text = text end |
#max_value=(value) ⇒ Object
21 22 23 |
# File 'lib/gecko/graph/geckometer.rb', line 21 def max_value=(value) self.max.value = value end |
#min_text=(text) ⇒ Object
17 18 19 |
# File 'lib/gecko/graph/geckometer.rb', line 17 def min_text=(text) self.min.text = text end |
#min_value=(value) ⇒ Object
13 14 15 |
# File 'lib/gecko/graph/geckometer.rb', line 13 def min_value=(value) self.min.value = value end |