Sha256: 355960baa386c9cf97fd590a08680107b133fc5bed011c0460eaf829c53c970d

Contents?: true

Size: 602 Bytes

Versions: 15

Compression:

Stored size: 602 Bytes

Contents

class Radiosonde::DSL::ComparisonOperator
  ALIASES = {
    'GreaterThanOrEqualToThreshold' => '>=',
    'GreaterThanThreshold'          => '>',
    'LessThanThreshold'             => '<',
    'LessThanOrEqualToThreshold'    => '<=',
  }

  class << self
    def conv_to_alias(operator)
      ALIASES[operator] || operator
    end

    def valid?(operator)
      ALIASES.keys.include?(operator) or ALIASES.values.include?(operator)
    end

    def normalize(operator)
      (ALIASES.respond_to?(:key) ? ALIASES.key(operator) : ALIASES.index(operator)) || operator
    end
  end # of class methods
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
radiosonde-0.2.0.beta5 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.2.0.beta4 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.2.0.beta3 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.2.0.beta2 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.2.0.beta lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.1.1 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.1.0 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.8 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.7 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.6 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.5 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.4 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.3 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.2 lib/radiosonde/dsl/comparison_operator.rb
radiosonde-0.0.1 lib/radiosonde/dsl/comparison_operator.rb