Class: Travis::Client::Request

Inherits:
WeakEntity show all
Defined in:
lib/travis/client/request.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

#base_commitObject (readonly)

Returns the value of attribute base_commit.



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

def base_commit
  @base_commit
end

#branchObject (readonly)

Returns the value of attribute branch.



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

def branch
  @branch
end

#commit_idObject (readonly)

Returns the value of attribute commit_id.



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

def commit_id
  @commit_id
end

#created_atObject (readonly)

Returns the value of attribute created_at.



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

def created_at
  @created_at
end

#event_typeObject (readonly)

Returns the value of attribute event_type.



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

def event_type
  @event_type
end

#head_commitObject (readonly)

Returns the value of attribute head_commit.



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

def head_commit
  @head_commit
end

#messageObject (readonly)

Returns the value of attribute message.



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

def message
  @message
end

#owner_idObject (readonly)

Returns the value of attribute owner_id.



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

def owner_id
  @owner_id
end

#owner_typeObject (readonly)

Returns the value of attribute owner_type.



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

def owner_type
  @owner_type
end

#pull_requestObject (readonly)

Returns the value of attribute pull_request.



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

def pull_request
  @pull_request
end

#pull_request_numberObject (readonly)

Returns the value of attribute pull_request_number.



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

def pull_request_number
  @pull_request_number
end

#pull_request_titleObject (readonly)

Returns the value of attribute pull_request_title.



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

def pull_request_title
  @pull_request_title
end

#repositoryObject (readonly)

Returns the value of attribute repository.



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

def repository
  @repository
end

#repository_idObject (readonly)

Returns the value of attribute repository_id.



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

def repository_id
  @repository_id
end

#resultObject (readonly)

Returns the value of attribute result.



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

def result
  @result
end

#tagObject (readonly)

Returns the value of attribute tag.



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

def tag
  @tag
end

Instance Method Details

#accepted?Boolean

Returns:

  • (Boolean)


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

def accepted?
  result == 'accepted'
end

#inspect_infoObject



28
29
30
31
32
33
# File 'lib/travis/client/request.rb', line 28

def inspect_info
  [
    repository && repository.slug,
    event_type, branch || pull_request_number, result
  ].compact.join(" ")
end

#ownerObject



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

def owner
  repository.owner
end

#rejected?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'lib/travis/client/request.rb', line 24

def rejected?
  result == 'rejected'
end