Sha256: 9a24edeb61749b44f35ed733b2063d326f6a86b0e59fa0eb4fc6c46f7cded846

Contents?: true

Size: 581 Bytes

Versions: 15

Compression:

Stored size: 581 Bytes

Contents

class Radiosonde::DSL::Statistic
  ALIASES = {
    'SampleCount' => :sample_count,
    'Average'     => :average,
    'Sum'         => :sum,
    'Minimum'     => :minimum,
    'Maximum'     => :maximum,
  }

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

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

    def normalize(statistic)
      (ALIASES.respond_to?(:key) ? ALIASES.key(statistic) : ALIASES.index(statistic)) || statistic
    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/statistic.rb
radiosonde-0.2.0.beta4 lib/radiosonde/dsl/statistic.rb
radiosonde-0.2.0.beta3 lib/radiosonde/dsl/statistic.rb
radiosonde-0.2.0.beta2 lib/radiosonde/dsl/statistic.rb
radiosonde-0.2.0.beta lib/radiosonde/dsl/statistic.rb
radiosonde-0.1.1 lib/radiosonde/dsl/statistic.rb
radiosonde-0.1.0 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.8 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.7 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.6 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.5 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.4 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.3 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.2 lib/radiosonde/dsl/statistic.rb
radiosonde-0.0.1 lib/radiosonde/dsl/statistic.rb