class Digiproc::DataProperties::Slope::Positive

Used in the Slope class to indicate a positive slope.

Made for easy syntax purposes

Public Class Methods

==(val) click to toggle source

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
# 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) click to toggle source

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
# File lib/concerns/data_properties.rb, line 183
def self.is?(val)
    self.==(val)
end
type() click to toggle source
# File lib/concerns/data_properties.rb, line 157
def self.type
    :positive
end