Class: OmgPullRequest::Lolcommits
- Inherits:
-
Object
- Object
- OmgPullRequest::Lolcommits
- Defined in:
- lib/omg_pull_request/lolcommits.rb
Constant Summary collapse
- LOLCOMMITS_PATH =
'/animated_gifs'
- LOLCOMMITS_URL =
"http://www.lolcommits.com"
Instance Attribute Summary collapse
-
#configuration ⇒ Object
Returns the value of attribute configuration.
-
#context ⇒ Object
Returns the value of attribute context.
-
#github_wrapper ⇒ Object
Returns the value of attribute github_wrapper.
-
#runner ⇒ Object
Returns the value of attribute runner.
Instance Method Summary collapse
- #animation_url ⇒ Object
-
#initialize(attributes = Hash.new) ⇒ Lolcommits
constructor
A new instance of Lolcommits.
Constructor Details
#initialize(attributes = Hash.new) ⇒ Lolcommits
Returns a new instance of Lolcommits.
7 8 9 10 11 |
# File 'lib/omg_pull_request/lolcommits.rb', line 7 def initialize(attributes=Hash.new) attributes.each do |attr, value| self.send("#{attr}=", value) end end |
Instance Attribute Details
#configuration ⇒ Object
Returns the value of attribute configuration.
5 6 7 |
# File 'lib/omg_pull_request/lolcommits.rb', line 5 def configuration @configuration end |
#context ⇒ Object
Returns the value of attribute context.
5 6 7 |
# File 'lib/omg_pull_request/lolcommits.rb', line 5 def context @context end |
#github_wrapper ⇒ Object
Returns the value of attribute github_wrapper.
5 6 7 |
# File 'lib/omg_pull_request/lolcommits.rb', line 5 def github_wrapper @github_wrapper end |
#runner ⇒ Object
Returns the value of attribute runner.
5 6 7 |
# File 'lib/omg_pull_request/lolcommits.rb', line 5 def runner @runner end |
Instance Method Details
#animation_url ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/omg_pull_request/lolcommits.rb', line 13 def animation_url return @animation_url if @animation_url commits = github_wrapper.commit_shas(runner.pull_request) - context.get_animated_shas(runner.pull_request.number) context.add_animated_shas(runner.pull_request.number, commits) @animation_url ||= get_animation_url(commits) end |