Class: Digiproc::DataProperties::Slope::Negative
- Inherits:
-
Object
- Object
- Digiproc::DataProperties::Slope::Negative
- Defined in:
- lib/concerns/data_properties.rb
Overview
Used in the Slope class to indicate a negative slope. Made for easy syntax purposes
Class Method Summary collapse
-
.==(val) ⇒ Object
Can test equality in multiple ways: Digiproc::DataProperties::Slope::Negative == OpenStruct.new(type: :negative) # true Digiproc::DataProperties::Slope::Negative == :negative # true Digiproc::DataProperties::Slope::Negative == “negative” # true.
-
.is?(val) ⇒ Boolean
Alias to == Can test equality in multiple ways: Digiproc::DataProperties::Slope::Negative.is? OpenStruct.new(type: :negative) # true Digiproc::DataProperties::Slope::Negative.is? :negative # true Digiproc::DataProperties::Slope::Negative.is? “negative” # true, not case sensitive.
-
.type ⇒ Object
Used for comparison in == returns :negative.
Class Method Details
.==(val) ⇒ Object
Can test equality in multiple ways: Digiproc::DataProperties::Slope::Negative == OpenStruct.new(type: :negative) # true Digiproc::DataProperties::Slope::Negative == :negative # true Digiproc::DataProperties::Slope::Negative == “negative” # true
131 132 133 134 135 136 137 138 139 140 |
# File 'lib/concerns/data_properties.rb', line 131 def self.==(val) if val.respond_to? :type return true if val.type == :negative end return true if val == :negative if val.respond_to? :downcase return true if val.downcase == "negative" end false end |
.is?(val) ⇒ Boolean
Alias to == Can test equality in multiple ways: Digiproc::DataProperties::Slope::Negative.is? OpenStruct.new(type: :negative) # true Digiproc::DataProperties::Slope::Negative.is? :negative # true Digiproc::DataProperties::Slope::Negative.is? “negative” # true, not case sensitive
148 149 150 |
# File 'lib/concerns/data_properties.rb', line 148 def self.is?(val) self.==(val) end |
.type ⇒ Object
Used for comparison in == returns :negative
122 123 124 |
# File 'lib/concerns/data_properties.rb', line 122 def self.type :negative end |