Sha256: 97c1fe374019831ce31201335fe47f2c9ac02fbe5e9e5e0888464295fb61ac4e

Contents?: true

Size: 591 Bytes

Versions: 8

Compression:

Stored size: 591 Bytes

Contents

module Tabs
  module Resolution
    extend self

    def serialize(resolution, timestamp)
      resolution_klass(resolution).serialize(timestamp)
    end

    def deserialize(resolution, str)
      resolution_klass(resolution).deserialize(str)
    end

    def from_seconds(resolution, s)
      resolution_klass(resolution).from_seconds(s)
    end

    def normalize(resolution, timestamp)
      resolution_klass(resolution).normalize(timestamp)
    end

    private

    def resolution_klass(resolution)
      "Tabs::Resolutions::#{resolution.to_s.classify}".constantize
    end

  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
tabs-0.8.2 lib/tabs/resolution.rb
tabs-0.8.1 lib/tabs/resolution.rb
tabs-0.8.0 lib/tabs/resolution.rb
tabs-0.7.1 lib/tabs/resolution.rb
tabs-0.7.0 lib/tabs/resolution.rb
tabs-0.6.3 lib/tabs/resolution.rb
tabs-0.6.2 lib/tabs/resolution.rb
tabs-0.6.1 lib/tabs/resolution.rb