lib/lurker/presenters/service_presenter.rb in lurker-0.5.1 vs lib/lurker/presenters/service_presenter.rb in lurker-0.5.2

- old
+ new

@@ -1,11 +1,11 @@ # An BasePresenter for Lurker::Service class Lurker::ServicePresenter < Lurker::BasePresenter attr_reader :service extend Forwardable - def_delegators :service, :name, :service_dir, :meta_service, :domains + def_delegators :service, :name, :service_dir, :meta_service def initialize(service, options = {}, &block) super(options) @service = service @@ -22,9 +22,19 @@ render_erb('service.md.erb') end def title "Lurker | #{name}" + end + + def domains + return service.domains if service.domains.present? + { '/' => 'Local'} + end + + def default_domain + return service.domains.to_a[0][1] if service.domains.present? + '/' end def name_as_link(options = {}) path = service.meta_service ? index_path(slug_name) : index_path '<a href="%s">%s %s</a>' % [ path, options[:prefix], service.name ]