Module: WpTheme::Findable

Included in:
WpTheme
Defined in:
lib/common/models/wp_theme/findable.rb

Instance Method Summary collapse

Instance Method Details

#find(target_uri) ⇒ WpTheme

Find the main theme of the blog


11
12
13
14
15
16
17
18
19
20
# File 'lib/common/models/wp_theme/findable.rb', line 11

def find(target_uri)
  methods.grep(/^find_from_/).each do |method|
    if wp_theme = self.send(method, target_uri)
      wp_theme.found_from = method

      return wp_theme
    end
  end
  nil
end