Class: Travis::Client::Repository

Inherits:
Entity
  • Object
show all
Defined in:
lib/travis/client/repository.rb

Defined Under Namespace

Classes: Key

Constant Summary

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary

Attributes inherited from Entity

#attributes, #curry, #id, #session

Instance Method Summary collapse

Methods inherited from Entity

#[], #[]=, #attribute_names, attributes, #complete?, #include?, #initialize, #inspect, inspect_info, #load, many, #missing?, one, #reload, subclass_for, subclasses, #update_attributes

Constructor Details

This class inherits a constructor from Travis::Client::Entity

Instance Method Details

#encrypt(value) ⇒ Object



53
54
55
# File 'lib/travis/client/repository.rb', line 53

def encrypt(value)
  key.encrypt(value)
end

#last_build_finished_at=(time) ⇒ Object



61
62
63
# File 'lib/travis/client/repository.rb', line 61

def last_build_finished_at=(time)
  set_attribute(:last_build_finished_at, time(time))
end

#last_build_started_at=(time) ⇒ Object



57
58
59
# File 'lib/travis/client/repository.rb', line 57

def last_build_started_at=(time)
  set_attribute(:last_build_started_at, time(time))
end

#public_keyObject Also known as: key



38
39
40
41
42
43
# File 'lib/travis/client/repository.rb', line 38

def public_key
  attributes["public_key"] ||= begin
    payload = session.get_raw("/repos/#{id}/key")
    Key.new(payload.fetch('key'))
  end
end

#public_key=(key) ⇒ Object Also known as: key=



45
46
47
48
# File 'lib/travis/client/repository.rb', line 45

def public_key=(key)
  key = Key.new(key) unless key.is_a? Key
  set_attribute(:public_key, key)
end