Class: Travis::Client::Cache

Inherits:
WeakEntity show all
Defined in:
lib/travis/client/cache.rb

Constant Summary

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary collapse

Attributes inherited from Entity

#attributes, #curry, #id, #session

Instance Method Summary collapse

Methods inherited from WeakEntity

cast_id, id?, id_field, weak?

Methods included from NotLoadable

#complete?, #missing?

Methods inherited from Entity

#[], #[]=, aka, #attribute_names, attributes, base_path, #cancelable?, cast_id, #complete?, has, has_singleton, id?, id_field, #include?, #initialize, #inspect, inspect_info, #load, many, #missing?, one, preloadable, preloadable?, relations, #relations, #reload, #restartable?, subclass_for, subclasses, time, #to_h, #update_attributes, weak?

Constructor Details

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

Instance Attribute Details

#branchObject (readonly)

Returns the value of attribute branch.



1
2
3
# File 'lib/travis/client/cache.rb', line 1

def branch
  @branch
end

#last_modifiedObject (readonly)

Returns the value of attribute last_modified.



1
2
3
# File 'lib/travis/client/cache.rb', line 1

def last_modified
  @last_modified
end

#repositoryObject (readonly)

Returns the value of attribute repository.



1
2
3
# File 'lib/travis/client/cache.rb', line 1

def repository
  @repository
end

#repository_idObject (readonly)

Returns the value of attribute repository_id.



1
2
3
# File 'lib/travis/client/cache.rb', line 1

def repository_id
  @repository_id
end

#sizeObject (readonly)

Returns the value of attribute size.



1
2
3
# File 'lib/travis/client/cache.rb', line 1

def size
  @size
end

#slugObject (readonly)

Returns the value of attribute slug.



1
2
3
# File 'lib/travis/client/cache.rb', line 1

def slug
  @slug
end

Instance Method Details

#deleteObject



16
17
18
# File 'lib/travis/client/cache.rb', line 16

def delete
  repository.delete_caches(:branch => branch, :match => slug)
end

#inspect_infoObject



20
21
22
# File 'lib/travis/client/cache.rb', line 20

def inspect_info
  [repository.slug, branch, slug].compact.join(" ")
end