class Travis::Client::Account

Public Class Methods

cast_id(id) click to toggle source
# File lib/travis/client/account.rb, line 14
def self.cast_id(id)
  String(id)
end
id?(object) click to toggle source
# File lib/travis/client/account.rb, line 18
def self.id?(object)
  object.is_a? String
end

Public Instance Methods

education() click to toggle source
# File lib/travis/client/account.rb, line 26
def education
  load_attribute('education') { false } if member?
end
member?() click to toggle source
# File lib/travis/client/account.rb, line 42
def member?
  session.accounts.include? self
end
on_trial?() click to toggle source
# File lib/travis/client/account.rb, line 30
def on_trial?
  !subscribed? and !education?
end
repos_count() click to toggle source
# File lib/travis/client/account.rb, line 34
def repos_count
  load_attribute("repos_count") { repositories.count }
end
repositories() click to toggle source
# File lib/travis/client/account.rb, line 38
def repositories
  attributes['repositories'] ||= session.repos(:owner_name => login)
end
subscribed() click to toggle source
# File lib/travis/client/account.rb, line 22
def subscribed
  load_attribute('subscribed') { true } if member?
end

Private Instance Methods

load_attribute(name, &block) click to toggle source
# File lib/travis/client/account.rb, line 50
def load_attribute(name, &block)
  session.accounts if missing? name
  block ? attributes.fetch(name.to_s, &block) : attributes[name.to_s]
end