Skip to content

Commit

Permalink
Remove unused param
Browse files Browse the repository at this point in the history
  • Loading branch information
r00k committed Feb 19, 2015
1 parent 0ebee6d commit 71b4021
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
5 changes: 1 addition & 4 deletions app/services/explore.rb
@@ -1,6 +1,4 @@
class Explore
LIMIT = 3

def initialize(user)
@user = user
end
Expand All @@ -17,8 +15,7 @@ def topics
topics = TopicsWithResources.new(
topics: Topic.explorable,
factory: TopicWithResourcesFactory.new(
catalog: Catalog.new,
limit: LIMIT
catalog: Catalog.new
)
)
topics.to_a.sort_by(&:count).reverse
Expand Down
3 changes: 1 addition & 2 deletions app/services/topic_with_resources.rb
@@ -1,10 +1,9 @@
# Decorates a Topic to allow attaching a list of related resources, such as
# exercises and video tutorials.
class TopicWithResources < SimpleDelegator
def initialize(topic, resources:, limit: nil)
def initialize(topic, resources:)
super(topic)
@resources = resources
@limit = limit
end

def resources
Expand Down
6 changes: 2 additions & 4 deletions app/services/topic_with_resources_factory.rb
Expand Up @@ -3,17 +3,15 @@
class TopicWithResourcesFactory
RESOURCE_TYPES = %i(products videos)

def initialize(catalog:, limit: nil)
def initialize(catalog:)
@catalog = catalog
@resources = {}
@limit = limit
end

def decorate(topic)
TopicWithResources.new(
topic,
resources: resources(topic),
limit: @limit
resources: resources(topic)
)
end

Expand Down

0 comments on commit 71b4021

Please sign in to comment.