Parent

Class Index

Quicksearch

Ziya::Gauges::Base

Attributes

components[R]

(Not documented)

design_id[RW]

(Not documented)

license[RW]

(Not documented)

options[R]

(Not documented)

type[R]

(Not documented)

Public Class Methods

new( license, design_id ) click to toggle source

(Not documented)

    # File lib/ziya/gauges/base.rb, line 14
14:     def initialize( license, design_id )
15:       @license   = license
16:       @design_id = design_id
17:       
18:       # load up associated helper
19:       loaded = load_helper( Ziya.helpers_dir ) if Ziya.helpers_dir
20:       Ziya.logger.debug( ">>> ZiYa -- no helper for gauge `#{design_id}" ) unless loaded
21: 
22:       # init defaults
23:       @options = default_options      
24:     end

Public Instance Methods

set_preferences( opts={} ) click to toggle source


provides for overiding basic functionality

gauge_color:Legend color
legend_color:Gauge color

    # File lib/ziya/gauges/base.rb, line 31
31:     def set_preferences( opts={} )
32:       options.merge!( opts )
33:     end
to_xml() click to toggle source


render gauge to xml

    # File lib/ziya/gauges/base.rb, line 37
37:     def to_xml
38:       render_xml
39:     end

Protected Instance Methods

default_options() click to toggle source


setup thermometer default options

    # File lib/ziya/gauges/base.rb, line 58
58:       def default_options
59:         { 
60:           :x            => 20,
61:           :y            => 20,
62:           :gauge_color  => "ff0000",
63:           :legend_color => "cc0000",
64:         }
65:       end
render_extra_components() click to toggle source

inject update behavior

    # File lib/ziya/gauges/base.rb, line 45
45:       def render_extra_components
46:         if options[:url]
47:           Ziya::Gauges::Support::Update.new(
48:             :url        => options[:url],
49:             :retry      => options[:retry] || 0,
50:             :timeout    => options[:timeout] || 30,
51:             :delay_type => options[:delay_type] || 1,
52:             :delay      => options[:delay] || 30 ).flatten( @xml )
53:         end
54:       end

secsequence

--- SEC00143

seccomment

--- ""

attributes

--- 
- name: components
  rw: R
  a_desc: ""
- name: design_id
  rw: RW
  a_desc: ""
- name: license
  rw: RW
  a_desc: ""
- name: options
  rw: R
  a_desc: ""
- name: type
  rw: R
  a_desc: ""

method_list

--- 
- methods: 
  - visibility: public
    aref: M000077
    name: new
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/gauges/base.rb, line 14</span>\n\
      14:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">initialize</span>( <span class=\"ruby-identifier\">license</span>, <span class=\"ruby-identifier\">design_id</span> )\n\
      15:       <span class=\"ruby-ivar\">@license</span>   = <span class=\"ruby-identifier\">license</span>\n\
      16:       <span class=\"ruby-ivar\">@design_id</span> = <span class=\"ruby-identifier\">design_id</span>\n\
      17:       \n\
      18:       <span class=\"ruby-comment cmt\"># load up associated helper</span>\n\
      19:       <span class=\"ruby-identifier\">loaded</span> = <span class=\"ruby-identifier\">load_helper</span>( <span class=\"ruby-constant\">Ziya</span>.<span class=\"ruby-identifier\">helpers_dir</span> ) <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-constant\">Ziya</span>.<span class=\"ruby-identifier\">helpers_dir</span>\n\
      20:       <span class=\"ruby-constant\">Ziya</span>.<span class=\"ruby-identifier\">logger</span>.<span class=\"ruby-identifier\">debug</span>( <span class=\"ruby-node\">&quot;&gt;&gt;&gt; ZiYa -- no helper for gauge `#{design_id}&quot;</span> ) <span class=\"ruby-keyword kw\">unless</span> <span class=\"ruby-identifier\">loaded</span>\n\
      21: \n\
      22:       <span class=\"ruby-comment cmt\"># init defaults</span>\n\
      23:       <span class=\"ruby-ivar\">@options</span> = <span class=\"ruby-identifier\">default_options</span>      \n\
      24:     <span class=\"ruby-keyword kw\">end</span>"
    params: ( license, design_id )
  category: Class
  type: Public
- methods: 
  - visibility: public
    aref: M000078
    name: set_preferences
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/gauges/base.rb, line 31</span>\n\
      31:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">set_preferences</span>( <span class=\"ruby-identifier\">opts</span>={} )\n\
      32:       <span class=\"ruby-identifier\">options</span>.<span class=\"ruby-identifier\">merge!</span>( <span class=\"ruby-identifier\">opts</span> )\n\
      33:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <hr size="10"></hr><p>
      provides for overiding basic functionality
      </p>
      <table>
      <tr><td valign="top"><tt>gauge_color</tt>:</td><td>Legend color
      
      </td></tr>
      <tr><td valign="top"><tt>legend_color</tt>:</td><td>Gauge color
      
      </td></tr>
      </table>
    params: ( opts={} )
  - visibility: public
    aref: M000079
    name: to_xml
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/gauges/base.rb, line 37</span>\n\
      37:     <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">to_xml</span>\n\
      38:       <span class=\"ruby-identifier\">render_xml</span>\n\
      39:     <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <hr size="10"></hr><p>
      render gauge to xml
      </p>
    params: ()
  category: Instance
  type: Public
- methods: 
  - visibility: protected
    aref: M000081
    name: default_options
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/gauges/base.rb, line 58</span>\n\
      58:       <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">default_options</span>\n\
      59:         { \n\
      60:           <span class=\"ruby-identifier\">:x</span>            =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value\">20</span>,\n\
      61:           <span class=\"ruby-identifier\">:y</span>            =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value\">20</span>,\n\
      62:           <span class=\"ruby-identifier\">:gauge_color</span>  =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;ff0000&quot;</span>,\n\
      63:           <span class=\"ruby-identifier\">:legend_color</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-value str\">&quot;cc0000&quot;</span>,\n\
      64:         }\n\
      65:       <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <hr size="10"></hr><p>
      setup thermometer default options
      </p>
    params: ()
  - visibility: protected
    aref: M000080
    name: render_extra_components
    sourcecode: "    <span class=\"ruby-comment cmt\"># File lib/ziya/gauges/base.rb, line 45</span>\n\
      45:       <span class=\"ruby-keyword kw\">def</span> <span class=\"ruby-identifier\">render_extra_components</span>\n\
      46:         <span class=\"ruby-keyword kw\">if</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:url</span>]\n\
      47:           <span class=\"ruby-constant\">Ziya</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Gauges</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Support</span><span class=\"ruby-operator\">::</span><span class=\"ruby-constant\">Update</span>.<span class=\"ruby-identifier\">new</span>(\n\
      48:             <span class=\"ruby-identifier\">:url</span>        =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:url</span>],\n\
      49:             <span class=\"ruby-identifier\">:retry</span>      =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:retry</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-value\">0</span>,\n\
      50:             <span class=\"ruby-identifier\">:timeout</span>    =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:timeout</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-value\">30</span>,\n\
      51:             <span class=\"ruby-identifier\">:delay_type</span> =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:delay_type</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-value\">1</span>,\n\
      52:             <span class=\"ruby-identifier\">:delay</span>      =<span class=\"ruby-operator\">&gt;</span> <span class=\"ruby-identifier\">options</span>[<span class=\"ruby-identifier\">:delay</span>] <span class=\"ruby-operator\">||</span> <span class=\"ruby-value\">30</span> ).<span class=\"ruby-identifier\">flatten</span>( <span class=\"ruby-ivar\">@xml</span> )\n\
      53:         <span class=\"ruby-keyword kw\">end</span>\n\
      54:       <span class=\"ruby-keyword kw\">end</span>"
    m_desc: |-
      <p>
      inject update behavior
      </p>
    params: ()
  category: Instance
  type: Protected

sectitle

--- 

[Validate]

Generated with the Darkfish Rdoc Generator.