Class: Digiproc::DataProperties::Slope::Positive
- Inherits:
-
Object
- Object
- Digiproc::DataProperties::Slope::Positive
- Defined in:
- lib/concerns/data_properties.rb
Overview
Used in the Slope class to indicate a positive slope. Made for easy syntax purposes
Class Method Summary collapse
-
.==(val) ⇒ Object
Can test equality in multiple ways: Digiproc::DataProperties::Slope::Positive == OpenStruct.new(type: :positive) # true Digiproc::DataProperties::Slope::Positive == :positive # true Digiproc::DataProperties::Slope::Negative == “positive” # true, not case-sensitive.
-
.is?(val) ⇒ Boolean
Alias to == Can test equality in multiple ways: Digiproc::DataProperties::Slope::Piositive.is? OpenStruct.new(type: :negative) # true Digiproc::DataProperties::Slope::Positive.is? :positive # true Digiproc::DataProperties::Slope::Positive.is? “positive” # true, not case-sensitive.
- .type ⇒ Object
Class Method Details
.==(val) ⇒ Object
Can test equality in multiple ways: Digiproc::DataProperties::Slope::Positive == OpenStruct.new(type: :positive) # true Digiproc::DataProperties::Slope::Positive == :positive # true Digiproc::DataProperties::Slope::Negative == “positive” # true, not case-sensitive
166 167 168 169 170 171 172 173 174 175 |
# File 'lib/concerns/data_properties.rb', line 166 def self.==(val) if val.respond_to? :type return true if val.type == :positive end return true if val == :positive if val.respond_to? :downcase return true if val.downcase == "positive" end false end |
.is?(val) ⇒ Boolean
Alias to == Can test equality in multiple ways: Digiproc::DataProperties::Slope::Piositive.is? OpenStruct.new(type: :negative) # true Digiproc::DataProperties::Slope::Positive.is? :positive # true Digiproc::DataProperties::Slope::Positive.is? “positive” # true, not case-sensitive
183 184 185 |
# File 'lib/concerns/data_properties.rb', line 183 def self.is?(val) self.==(val) end |
.type ⇒ Object
157 158 159 |
# File 'lib/concerns/data_properties.rb', line 157 def self.type :positive end |