lib/travis/client/account.rb in travis-1.7.2.travis.623.5 vs lib/travis/client/account.rb in travis-1.7.2.travis.625.5
- old
+ new
@@ -1,11 +1,11 @@
require 'travis/client'
module Travis
module Client
class Account < Entity
- attributes :name, :login, :type, :repos_count, :subscribed
+ attributes :name, :login, :type, :repos_count, :subscribed, :education
one :account
many :accounts
inspect_info :login
@@ -21,10 +21,18 @@
def subscribed
load_attribute('subscribed') { true } if member?
end
+ def education
+ load_attribute('education') { false } if member?
+ end
+
+ def on_trial?
+ !subscribed? and !education?
+ end
+
def repos_count
load_attribute("repos_count") { repositories.count }
end
def repositories
@@ -32,9 +40,11 @@
end
def member?
session.accounts.include? self
end
+
+ alias educational? education?
private
def load_attribute(name, &block)
session.accounts if missing? name