Sha256: 690aaee7e7f68ae36fd2606fae2e1a24667d623801695697e973f94c87465e67

Contents?: true

Size: 562 Bytes

Versions: 6

Compression:

Stored size: 562 Bytes

Contents

module FireEagle
  class Locations
    include Enumerable
    include HappyMapper

    tag "locations"
    attribute :count, Integer
    attribute :start, Integer
    attribute :total, Integer
    has_many  :locations, Location, :single => false

    def [](*args)
      locations[*args]
    end

    alias_method :slice, :[]

    def each(&block)
      locations.each(&block)
    end

    def first
      locations.first
    end

    def last
      locations.last
    end

    def length
      locations.length
    end

    alias_method :size, :length
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

Version Path
jnewland-fireeagle-0.8.0.1 lib/fireeagle/locations.rb
jnewland-fireeagle-0.8.99.1 lib/fireeagle/locations.rb
mojodna-fireeagle-0.8.0.1 lib/fireeagle/locations.rb
mojodna-fireeagle-0.8.99.1 lib/fireeagle/locations.rb
mojodna-fireeagle-0.8.99 lib/fireeagle/locations.rb
fireeagle-0.8.0.1 lib/fireeagle/locations.rb