Class: Middleman::Sitemap::Extensions::EndpointResource

Inherits:
Resource
  • Object
show all
Defined in:
lib/middleman-core/sitemap/extensions/request_endpoints.rb

Constant Summary

Constants inherited from Resource

Resource::METADATA_HASH

Constants included from Contracts

Contracts::PATH_MATCHER

Instance Attribute Summary collapse

Attributes inherited from Resource

#destination_path, #file_descriptor, #ignored, #metadata, #path

Instance Method Summary collapse

Methods inherited from Resource

#Any, #Bool, #Hash, #METADATA_HASH, #String, #add_metadata, #binary?, #content_type, #data, #ext, #ignore!, #indifferent_access?, #locals, #options, #page_id, #proxy_to, #source_file, #to_s, #url

Methods included from Traversal

#children, #directory_index?, #eponymous_directory?, #eponymous_directory_path, #parent, #siblings, #traversal_root

Methods included from Contracts

#Contract

Constructor Details

#initialize(store, path, request_path) ⇒ EndpointResource

Returns a new instance of EndpointResource.



43
44
45
46
# File 'lib/middleman-core/sitemap/extensions/request_endpoints.rb', line 43

def initialize(store, path, request_path)
  super(store, path)
  @request_path = ::Middleman::Util.normalize_path(request_path)
end

Instance Attribute Details

#outputObject

Returns the value of attribute output.



41
42
43
# File 'lib/middleman-core/sitemap/extensions/request_endpoints.rb', line 41

def output
  @output
end

#request_pathObject (readonly)

Returns the value of attribute request_path.



49
50
51
# File 'lib/middleman-core/sitemap/extensions/request_endpoints.rb', line 49

def request_path
  @request_path
end

Instance Method Details

#ignored?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/middleman-core/sitemap/extensions/request_endpoints.rb', line 62

def ignored?
  false
end

#renderObject



57
58
59
# File 'lib/middleman-core/sitemap/extensions/request_endpoints.rb', line 57

def render(*)
  return output.call if output
end

#template?Boolean

Returns:

  • (Boolean)


52
53
54
# File 'lib/middleman-core/sitemap/extensions/request_endpoints.rb', line 52

def template?
  true
end