Class: Digiproc::DataProperties::Slope::Zero
- Inherits:
-
Object
- Object
- Digiproc::DataProperties::Slope::Zero
- Defined in:
- lib/concerns/data_properties.rb
Overview
Used in the Slope class to indicate a zero slope. Made for easy syntax purposes
Class Method Summary collapse
-
.==(val) ⇒ Object
Can test equality in multiple ways: Digiproc::DataProperties::Slope::Zero == OpenStruct.new(type: :zero) # true Digiproc::DataProperties::Slope::Zero == :zero # true Digiproc::DataProperties::Slope::Zero == “zero” # true, not case sensitive.
-
.is?(val) ⇒ Boolean
Alias to == Can test equality in multiple ways: Digiproc::DataProperties::Slope::Zero.is? OpenStruct.new(type: :zero) # true Digiproc::DataProperties::Slope::Zero.is? :zero # true Digiproc::DataProperties::Slope::Zero.is? “zero” # true, not case sensitive.
- .type ⇒ Object
Class Method Details
.==(val) ⇒ Object
Can test equality in multiple ways: Digiproc::DataProperties::Slope::Zero == OpenStruct.new(type: :zero) # true Digiproc::DataProperties::Slope::Zero == :zero # true Digiproc::DataProperties::Slope::Zero == “zero” # true, not case sensitive
201 202 203 204 205 206 207 208 209 210 |
# File 'lib/concerns/data_properties.rb', line 201 def self.==(val) if val.respond_to? :type return true if val.type == :zero end return true if val == :zero if val.respond_to? :downcase return true if val.downcase == "zero" end false end |
.is?(val) ⇒ Boolean
Alias to == Can test equality in multiple ways: Digiproc::DataProperties::Slope::Zero.is? OpenStruct.new(type: :zero) # true Digiproc::DataProperties::Slope::Zero.is? :zero # true Digiproc::DataProperties::Slope::Zero.is? “zero” # true, not case sensitive
218 219 220 |
# File 'lib/concerns/data_properties.rb', line 218 def self.is?(val) self.==(val) end |
.type ⇒ Object
192 193 194 |
# File 'lib/concerns/data_properties.rb', line 192 def self.type :zero end |