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, #normalized_path, #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.
238 239 240 241 242 |
# File 'lib/middleman-core/sitemap/resource.rb', line 238 def initialize(store, path, contents=nil, &block) @request_path = path @contents = block_given? ? block : contents super(store, path) end |
Instance Method Details
#binary? ⇒ Boolean
252 253 254 |
# File 'lib/middleman-core/sitemap/resource.rb', line 252 def binary? false end |
#render ⇒ Object
248 249 250 |
# File 'lib/middleman-core/sitemap/resource.rb', line 248 def render(*) @contents.respond_to?(:call) ? @contents.call : @contents end |
#template? ⇒ Boolean
244 245 246 |
# File 'lib/middleman-core/sitemap/resource.rb', line 244 def template? true end |