Sha256: 1f2301b8211aad54c524a3339220535ff6b230c9c74abc22afaeb997a456e34a

Contents?: true

Size: 958 Bytes

Versions: 31

Compression:

Stored size: 958 Bytes

Contents

#!/usr/bin/env ruby -w
# encoding: UTF-8
#
# = QueryResult.rb -- PostRunner - Manage the data from your Garmin sport devices.
#
# Copyright (c) 2015 by Chris Schlaeger <cs@taskjuggler.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of version 2 of the GNU General Public License as
# published by the Free Software Foundation.
#

module PostRunner

  # Queries provide an abstract interface to retrieve individual values from
  # Activities, Laps and so on. The result of a query is returned as a
  # QueryResult object.
  class QueryResult

    # Create a QueryResult object.
    # @param value [any] Result of the query
    # @param schema [Schema] A reference to the Schema of the queried
    #        attribute.
    def initialize(value, schema)
      @value = value
      @schema = schema
    end

    # Conver the result into a text String.
    def to_s
      @schema.to_s(@value)
    end

  end

end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
postrunner-1.2.0 lib/postrunner/QueryResult.rb
postrunner-1.1.1 lib/postrunner/QueryResult.rb
postrunner-1.1.0 lib/postrunner/QueryResult.rb
postrunner-1.0.5 lib/postrunner/QueryResult.rb
postrunner-1.0.4 lib/postrunner/QueryResult.rb
postrunner-1.0.2 lib/postrunner/QueryResult.rb
postrunner-1.0.1 lib/postrunner/QueryResult.rb
postrunner-1.0.0 lib/postrunner/QueryResult.rb
postrunner-0.12.0 lib/postrunner/QueryResult.rb
postrunner-0.11.0 lib/postrunner/QueryResult.rb
postrunner-0.10.1 lib/postrunner/QueryResult.rb
postrunner-0.10.0 lib/postrunner/QueryResult.rb
postrunner-0.9.0 lib/postrunner/QueryResult.rb
postrunner-0.8.1 lib/postrunner/QueryResult.rb
postrunner-0.8.0 lib/postrunner/QueryResult.rb
postrunner-0.7.5 lib/postrunner/QueryResult.rb
postrunner-0.7.4 lib/postrunner/QueryResult.rb
postrunner-0.7.3 lib/postrunner/QueryResult.rb
postrunner-0.7.2 lib/postrunner/QueryResult.rb
postrunner-0.7.1 lib/postrunner/QueryResult.rb