Class: Gecko::Widget::Geckometer

Inherits:
Gecko::Widget show all
Defined in:
lib/gecko/graph/geckometer.rb

Defined Under Namespace

Classes: EndPoint

Instance Attribute Summary collapse

Attributes inherited from Gecko::Widget

#data, #keys

Instance Method Summary collapse

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

#maxObject (readonly)

Returns the value of attribute max.



7
8
9
# File 'lib/gecko/graph/geckometer.rb', line 7

def max
  @max
end

#minObject (readonly)

Returns the value of attribute min.



7
8
9
# File 'lib/gecko/graph/geckometer.rb', line 7

def min
  @min
end

#valueObject

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_payloadObject



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