Skip to content

Commit

Permalink
Merge pull request #49 from Fullscreen/title_where
Browse files Browse the repository at this point in the history
Add page_name attribute for a video from API call
  • Loading branch information
philipqnguyen committed Jun 22, 2016
2 parents e421f8f + 7f84e5d commit ed2dc93
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,10 @@ For more information about changelogs, check
[Keep a Changelog](http://keepachangelog.com) and
[Vandamme](http://tech-angels.github.io/vandamme).

## 0.2.3 - 2016/06/22

* [FEATURE] Add `page_name` of a video found by API call (which is `Funky::Video.where`)

## 0.2.2 - 2016/06/17

* [BUGFIX] Single video id passed to the `Funky::Video.where` clause will not
Expand Down
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -65,6 +65,7 @@ videos.first.created_time # => #<DateTime: 2015-12-17T06:29:48+00:00>
videos.first.description # => "Hugh Jackman coaches Great Britain's..."
videos.first.length # => 147.05
videos.first.picture # => "https://scontent.xx.fbcdn.net/v/..."
videos.first.page_name # => "Moviefone"

```

Expand Down
2 changes: 1 addition & 1 deletion lib/funky/version.rb
@@ -1,3 +1,3 @@
module Funky
VERSION = "0.2.2"
VERSION = "0.2.3"
end
6 changes: 6 additions & 0 deletions lib/funky/video.rb
Expand Up @@ -40,6 +40,11 @@ def picture
data[:picture]
end

# @return [String] the name of Facebook page for the video.
def page_name
data.fetch(:from)[:name]
end

# @return [Integer] the total number of likes for the video.
def like_count
data[:like_count]
Expand Down Expand Up @@ -144,6 +149,7 @@ def self.fields
'created_time',
'description',
'length',
'from',
'picture'
]
end
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
@@ -1,6 +1,6 @@
require 'simplecov'
require 'coveralls'
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new [
SimpleCov::Formatter::HTMLFormatter,
Coveralls::SimpleCov::Formatter
]
Expand Down
1 change: 1 addition & 0 deletions spec/videos/video_spec.rb
Expand Up @@ -18,6 +18,7 @@
it { expect(video.description).to be_a(String) }
it { expect(video.length).to be_a(Float) }
it { expect(video.picture).to be_a(String)}
it { expect(video.page_name).to be_a(String) }
end

context 'given one unknown video ID was passed' do
Expand Down

0 comments on commit ed2dc93

Please sign in to comment.