Class: Jekyll::Favicon::StaticFile
- Inherits:
-
StaticFile
- Object
- StaticFile
- Jekyll::Favicon::StaticFile
- Includes:
- Referenceable, Sourceable, Taggable
- Defined in:
- lib/jekyll/favicon/static_file.rb,
lib/jekyll/favicon/static_file/mutable.rb,
lib/jekyll/favicon/static_file/taggable.rb,
lib/jekyll/favicon/static_file/sourceable.rb,
lib/jekyll/favicon/static_file/convertible.rb,
lib/jekyll/favicon/static_file/referenceable.rb
Overview
Class for static files from with spec dictionary Modify source from spec source Enable tags from spec tags Enable refer
Direct Known Subclasses
Defined Under Namespace
Modules: Convertible, Mutable, Referenceable, Sourceable, Taggable
Instance Attribute Summary collapse
-
#site ⇒ Object
readonly
Returns the value of attribute site.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #generable? ⇒ Boolean
- #href ⇒ Object
-
#initialize(site, spec = {}) ⇒ StaticFile
constructor
A new instance of StaticFile.
- #patch(configuration) ⇒ Object
- #taggable? ⇒ Boolean
Methods included from Referenceable
Methods included from Configuration::Defaults
base_name_to_parts, camelcase_to_snakecase, define_defaults, included, load_defaults, load_file
Methods included from Taggable
Methods included from Sourceable
#path, #source, source_filter, source_normalize, #source_relative_path, #sourceable?
Constructor Details
#initialize(site, spec = {}) ⇒ StaticFile
Returns a new instance of StaticFile.
25 26 27 28 29 30 31 |
# File 'lib/jekyll/favicon/static_file.rb', line 25 def initialize(site, spec = {}) raise StandardError unless spec.include? "name" @spec = spec spec_dir, spec_name = File.split spec_relative_path super site, site.source, spec_dir, spec_name end |
Instance Attribute Details
#site ⇒ Object (readonly)
Returns the value of attribute site.
23 24 25 |
# File 'lib/jekyll/favicon/static_file.rb', line 23 def site @site end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
23 24 25 |
# File 'lib/jekyll/favicon/static_file.rb', line 23 def spec @spec end |
Instance Method Details
#generable? ⇒ Boolean
33 34 35 |
# File 'lib/jekyll/favicon/static_file.rb', line 33 def generable? sourceable? end |
#href ⇒ Object
45 46 47 48 49 |
# File 'lib/jekyll/favicon/static_file.rb', line 45 def href Pathname.new("/") .join(*[site.baseurl, url].compact) .to_s end |
#patch(configuration) ⇒ Object
41 42 43 |
# File 'lib/jekyll/favicon/static_file.rb', line 41 def patch(configuration) taggable_patch spec_patch configuration end |
#taggable? ⇒ Boolean
37 38 39 |
# File 'lib/jekyll/favicon/static_file.rb', line 37 def taggable? generable? && super end |