class RLMResults

Public Instance Methods

[](index) click to toggle source
# File lib/project/realm/results.rb, line 6
def [](index)
  self.objectAtIndex(index)
end
avg_property(property) click to toggle source
# File lib/project/realm/results.rb, line 37
def avg_property(property)
  averageOfProperty(property)
end
empty?() click to toggle source
# File lib/project/realm/results.rb, line 45
def empty?
  count == 0
end
max_property(property) click to toggle source
# File lib/project/realm/results.rb, line 29
def max_property(property)
  maxOfProperty(property)
end
min_property(property) click to toggle source
# File lib/project/realm/results.rb, line 33
def min_property(property)
  minOfProperty(property)
end
sort_by(property, opts={}) click to toggle source
# File lib/project/realm/results.rb, line 10
def sort_by(property, opts={})
  ascending = if opts[:asc].nil?
    true
  else
    opts[:asc]
  end

  self.sortedResultsUsingProperty property, ascending: ascending
end
sum_property(property) click to toggle source
# File lib/project/realm/results.rb, line 41
def sum_property(property)
  sumOfProperty(property)
end
to_a() click to toggle source
# File lib/project/realm/results.rb, line 20
def to_a
  arr = []
  self.each do |object|
    arr << object
  end

  arr
end