Class: Ecoportal::API::V2::Page::Component::GaugeStop
- Inherits:
-
Common::Content::DoubleModel
- Object
- Common::BaseModel
- Common::Content::DoubleModel
- Ecoportal::API::V2::Page::Component::GaugeStop
- Defined in:
- lib/ecoportal/api/v2/page/component/gauge_stop.rb
Constant Summary
Constants included from Common::Content::DoubleModel::Diffable
Common::Content::DoubleModel::Diffable::DIFF_CLASS
Constants included from Common::Content::DoubleModel::Base
Common::Content::DoubleModel::Base::NOT_USED
Instance Attribute Summary
Attributes included from Common::Content::DoubleModel::Parented
Class Method Summary collapse
Instance Method Summary collapse
-
#color=(value) ⇒ Object
Assign the color to the stop.
-
#color_sym ⇒ Symbol
To get the
colorsym code.
Methods inherited from Common::Content::DoubleModel
Methods included from Common::Content::DoubleModel::Diffable
Methods included from Common::Content::Includer
Constructor Details
This class inherits a constructor from Ecoportal::API::Common::Content::DoubleModel
Class Method Details
.new_doc ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/ecoportal/api/v2/page/component/gauge_stop.rb', line 8 def new_doc { 'id' => new_uuid, 'threshold' => nil, 'color' => nil } end |
Instance Method Details
#color=(value) ⇒ Object
Note:
These are the available colors:
- :blue, :blue_greyed, :blue_light
- :turquoise, :jade, :green, :pistachio, :avocado
- :yellow, :orange, :pumpkin, :red, :magenta, :fuchsia, :purple, :violet
Assign the color to the stop.
27 28 29 30 |
# File 'lib/ecoportal/api/v2/page/component/gauge_stop.rb', line 27 def color=(value) value = to_color(value) if value.is_a?(Symbol) doc['color'] = value end |
#color_sym ⇒ Symbol
Returns to get the color sym code.
33 34 35 36 37 38 39 |
# File 'lib/ecoportal/api/v2/page/component/gauge_stop.rb', line 33 def color_sym color_maps.each do |k, v| return k if color == v end :undefined end |