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-0.7.0 lib/postrunner/QueryResult.rb
postrunner-0.6.0 lib/postrunner/QueryResult.rb
postrunner-0.5.0 lib/postrunner/QueryResult.rb
postrunner-0.4.0 lib/postrunner/QueryResult.rb
postrunner-0.3.0 lib/postrunner/QueryResult.rb
postrunner-0.2.1 lib/postrunner/QueryResult.rb
postrunner-0.2.0 lib/postrunner/QueryResult.rb
postrunner-0.1.0 lib/postrunner/QueryResult.rb
postrunner-0.0.11 lib/postrunner/QueryResult.rb
postrunner-0.0.10 lib/postrunner/QueryResult.rb
postrunner-0.0.9 lib/postrunner/QueryResult.rb