Class: Travis::Client::WeakEntity

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

Direct Known Subclasses

Cache

Constant Summary

Constants inherited from Entity

Entity::MAP

Instance Attribute Summary

Attributes inherited from Entity

#attributes, #curry, #id, #session

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#[], #[]=, aka, #attribute_names, attributes, #cancelable?, has, #include?, #initialize, #inspect, inspect_info, #load, many, one, preloadable, preloadable?, relations, #relations, #reload, #restartable?, subclass_for, subclasses, time, #update_attributes

Constructor Details

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

Class Method Details

.cast_id(object) ⇒ Object



18
19
20
21
# File 'lib/travis/client/weak_entity.rb', line 18

def self.cast_id(object)
  return object if id? object
  raise "weak entities do not have id fields"
end

.id?(object) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/travis/client/weak_entity.rb', line 14

def self.id?(object)
  object.nil?
end

.id_fieldObject



10
11
12
# File 'lib/travis/client/weak_entity.rb', line 10

def self.id_field
  raise "weak entities do not have id fields"
end

.weak?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'lib/travis/client/weak_entity.rb', line 6

def self.weak?
  true
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/travis/client/weak_entity.rb', line 27

def complete?
  true
end

#missing?(attribute) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/travis/client/weak_entity.rb', line 23

def missing?(attribute)
  false
end