Sha256: 1a266ddc1bd362c84084197049a76f097a17e44163a41d6092395f968376f1f6

Contents?: true

Size: 442 Bytes

Versions: 6

Compression:

Stored size: 442 Bytes

Contents

require 'volt/models/array_model'

module Volt
  class Cursor < ArrayModel
    # Some cursors return a value instead of an ArrayModel, in this case, we
    # store the array in the ArrayModel (so we can reuse ArrayModel's path)
    # TODO: should abstract this into a base class.
    def value=(val)
      @array = val
      @has_value = true
    end

    def value
      @array
    end

    def has_value?
      @has_value
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
volt-0.9.7.pre8 lib/volt/models/cursor.rb
volt-0.9.7.pre7 lib/volt/models/cursor.rb
volt-0.9.7.pre6 lib/volt/models/cursor.rb
volt-0.9.7.pre5 lib/volt/models/cursor.rb
volt-0.9.7.pre3 lib/volt/models/cursor.rb
volt-0.9.7.pre2 lib/volt/models/cursor.rb