Sha256: e79c00540f722f7d90c4f4e5f5ed25d3ba20a02524ad30ddc1a6426b64dc6107

Contents?: true

Size: 494 Bytes

Versions: 6

Compression:

Stored size: 494 Bytes

Contents

module FireEagle
  class User
    include HappyMapper

    tag "user"
    attribute :located_at, Time, :tag => "located-at"
    attribute :readable, Boolean
    attribute :token, String
    attribute :writable, Boolean
    has_one   :location_hierarchy, LocationHierarchy, :tag => "location-hierarchy"

    def best_guess
      @best_guess ||= locations.select { |loc| loc.best_guess? }.first
    end

    def locations
      location_hierarchy && location_hierarchy.locations
    end
  end
end

Version data entries

6 entries across 6 versions & 3 rubygems

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