Skip to content

Commit

Permalink
Rename vimeo_url to vimeo_params
Browse files Browse the repository at this point in the history
  • Loading branch information
paneq committed Aug 29, 2013
1 parent 4fd768b commit ee2c86f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions lib/embedda/filters/provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def initialize(options)
def get(filter_name)
case filter_name
when :vimeo
Vimeo.new(protocol, video_width, video_height, vimeo_url)
Vimeo.new(protocol, video_width, video_height, vimeo_params)
when :youtube
Youtube.new(protocol, video_width, video_height)
when :soundcloud
Expand All @@ -38,8 +38,8 @@ def video_height
options.fetch(:video_height, 315)
end

def vimeo_url
options.fetch(:vimeo_url, nil)
def vimeo_params
options.fetch(:vimeo_params, nil)
end

end
Expand Down
6 changes: 3 additions & 3 deletions lib/embedda/filters/vimeo.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
class Embedda
module Filters
class Vimeo
def initialize(protocol, width, height, vimeo_url)
def initialize(protocol, width, height, vimeo_params)
@protocol = protocol
@width = width
@height = height
@vimeo_url= vimeo_url
@vimeo_params= vimeo_params
end

def process(string)
Expand All @@ -27,7 +27,7 @@ def player_url(token)
url = URI.parse("http://player.vimeo.com/")
url.scheme = @protocol
url.path = "/video/#{token}"
url.query = Rack::Utils.build_query @vimeo_url if @vimeo_url
url.query = Rack::Utils.build_query @vimeo_params if @vimeo_params
url.to_s
end

Expand Down
2 changes: 1 addition & 1 deletion spec/embedda_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

it 'generates iframe with query string' do
@story = "http://vimeo.com/20241459"
embedda = described_class.new(@story, :vimeo_url => {:title => 0, :byline => 0, :portrait => 0, :color => "42b7ed"}).embed
embedda = described_class.new(@story, :vimeo_params => {:title => 0, :byline => 0, :portrait => 0, :color => "42b7ed"}).embed
expect(embedda).to eq(query_string_embed)
end

Expand Down

0 comments on commit ee2c86f

Please sign in to comment.