Sha256: 3a881b9c5f481b59752e31ef10f68132b2c8bbf5c25fb2a2bba95362493b65c1

Contents?: true

Size: 656 Bytes

Versions: 4

Compression:

Stored size: 656 Bytes

Contents

class Radiosonde::DSL::TreatMissingData
  ALIASES = {
    'breaching'    => :breaching,
    'notBreaching' => :not_breaching,
    'ignore'       => :ignore,
    'missing'      => :missing
  }

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

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

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

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
radiosonde-0.2.0.beta5 lib/radiosonde/dsl/treat_missing_data.rb
radiosonde-0.2.0.beta4 lib/radiosonde/dsl/treat_missing_data.rb
radiosonde-0.2.0.beta3 lib/radiosonde/dsl/treat_missing_data.rb
radiosonde-0.2.0.beta2 lib/radiosonde/dsl/treat_missing_data.rb