Class: PostRunner::QueryResult

Inherits:
Object
  • Object
show all
Defined in:
lib/postrunner/QueryResult.rb

Overview

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.

Instance Method Summary collapse

Constructor Details

#initialize(value, schema) ⇒ QueryResult

Create a QueryResult object.

Parameters:

  • value (any)

    Result of the query

  • schema (Schema)

    A reference to the Schema of the queried attribute.



24
25
26
27
# File 'lib/postrunner/QueryResult.rb', line 24

def initialize(value, schema)
  @value = value
  @schema = schema
end

Instance Method Details

#to_sObject

Conver the result into a text String.



30
31
32
# File 'lib/postrunner/QueryResult.rb', line 30

def to_s
  @schema.to_s(@value)
end