Class: EnvPullRequest::Base
- Inherits:
-
Object
- Object
- EnvPullRequest::Base
- Defined in:
- lib/env_pull_request/base.rb
Instance Attribute Summary collapse
-
#pull_request_id ⇒ Object
readonly
Returns the value of attribute pull_request_id.
Instance Method Summary collapse
- #fetch_pull_request_id ⇒ Object
-
#initialize ⇒ Base
constructor
A new instance of Base.
- #pull_request? ⇒ Boolean
Constructor Details
#initialize ⇒ Base
Returns a new instance of Base.
5 6 7 |
# File 'lib/env_pull_request/base.rb', line 5 def initialize @pull_request_id = fetch_pull_request_id end |
Instance Attribute Details
#pull_request_id ⇒ Object (readonly)
Returns the value of attribute pull_request_id.
3 4 5 |
# File 'lib/env_pull_request/base.rb', line 3 def pull_request_id @pull_request_id end |
Instance Method Details
#fetch_pull_request_id ⇒ Object
9 10 11 12 13 |
# File 'lib/env_pull_request/base.rb', line 9 def fetch_pull_request_id if ENV['TRAVIS_PULL_REQUEST'] && ENV['TRAVIS_PULL_REQUEST'].downcase != 'false' ENV['TRAVIS_PULL_REQUEST'].to_i end end |
#pull_request? ⇒ Boolean
15 16 17 |
# File 'lib/env_pull_request/base.rb', line 15 def pull_request? !pull_request_id.nil? end |