Class: Scribo::SiteFindService
- Inherits:
-
ApplicationService
- Object
- ApplicationService
- Scribo::SiteFindService
- Defined in:
- app/services/scribo/site_find_service.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ SiteFindService
constructor
A new instance of SiteFindService.
- #perform ⇒ Object
Methods inherited from ApplicationService
Constructor Details
#initialize(options = {}) ⇒ SiteFindService
Returns a new instance of SiteFindService.
9 10 11 12 |
# File 'app/services/scribo/site_find_service.rb', line 9 def initialize( = {}) super() @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
7 8 9 |
# File 'app/services/scribo/site_find_service.rb', line 7 def @options end |
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/services/scribo/site_find_service.rb', line 14 def perform return [:site] if [:site].is_a?(Scribo::Site) scribable = Scribo.config.scribable_for_request([:request]) return nil unless scribable scope = scribable.sites scope = scope.for_host([:host]) scope = scope.for_path([:path]) if [:path] scope.first end |