Class: Middleman::Sitemap::StringResource
- Defined in:
- lib/middleman-core/sitemap/resource.rb
Constant Summary
Constants inherited from Resource
Constants included from Contracts
Instance Attribute Summary
Attributes inherited from Resource
#destination_path, #file_descriptor, #ignored, #metadata, #path
Instance Method Summary collapse
- #binary? ⇒ Boolean
-
#initialize(store, path, contents = nil, &block) ⇒ StringResource
constructor
A new instance of StringResource.
- #render ⇒ Object
- #template? ⇒ Boolean
Methods inherited from Resource
#Any, #Bool, #Hash, #METADATA_HASH, #String, #add_metadata, #content_type, #data, #ext, #ignore!, #ignored?, #indifferent_access?, #locals, #options, #page_id, #proxy_to, #source_file, #to_s, #url
Methods included from Extensions::Traversal
#children, #directory_index?, #eponymous_directory?, #eponymous_directory_path, #parent, #siblings, #traversal_root
Methods included from Contracts
Constructor Details
#initialize(store, path, contents = nil, &block) ⇒ StringResource
Returns a new instance of StringResource.
207 208 209 210 211 |
# File 'lib/middleman-core/sitemap/resource.rb', line 207 def initialize(store, path, contents=nil, &block) @request_path = path @contents = block_given? ? block : contents super(store, path) end |
Instance Method Details
#binary? ⇒ Boolean
221 222 223 |
# File 'lib/middleman-core/sitemap/resource.rb', line 221 def binary? false end |
#render ⇒ Object
217 218 219 |
# File 'lib/middleman-core/sitemap/resource.rb', line 217 def render(*) @contents.respond_to?(:call) ? @contents.call : @contents end |
#template? ⇒ Boolean
213 214 215 |
# File 'lib/middleman-core/sitemap/resource.rb', line 213 def template? true end |