Class: Alchemy::PageFinder

Inherits:
Object
  • Object
show all
Defined in:
app/services/alchemy/page_finder.rb

Defined Under Namespace

Classes: Result

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(urlname) ⇒ PageFinder

Returns a new instance of PageFinder.



9
10
11
# File 'app/services/alchemy/page_finder.rb', line 9

def initialize(urlname)
  @urlname = urlname
end

Instance Attribute Details

#urlnameObject (readonly)

Returns the value of attribute urlname.



5
6
7
# File 'app/services/alchemy/page_finder.rb', line 5

def urlname
  @urlname
end

Instance Method Details

#callPageFinder::Result?

Returns:



14
15
16
17
18
# File 'app/services/alchemy/page_finder.rb', line 14

def call
  return if urlname.blank?

  find_by_urlname || find_by_wildcard_url
end