Class: Jekyll::Minibundle::AssetFileDrop
- Inherits:
-
Liquid::Drop
- Object
- Liquid::Drop
- Jekyll::Minibundle::AssetFileDrop
- Extended by:
- Forwardable
- Defined in:
- lib/jekyll/minibundle/asset_file_drop.rb
Constant Summary collapse
- KEYS =
%w{ name extname basename modified_time path collection }.freeze
Instance Method Summary collapse
-
#initialize(file) ⇒ AssetFileDrop
constructor
A new instance of AssetFileDrop.
- #inspect ⇒ Object
- #key?(key) ⇒ Boolean
- #keys ⇒ Object
- #to_h ⇒ Object (also: #to_hash)
Constructor Details
#initialize(file) ⇒ AssetFileDrop
Returns a new instance of AssetFileDrop.
16 17 18 |
# File 'lib/jekyll/minibundle/asset_file_drop.rb', line 16 def initialize(file) @file = file end |
Instance Method Details
#inspect ⇒ Object
36 37 38 39 |
# File 'lib/jekyll/minibundle/asset_file_drop.rb', line 36 def inspect require 'json' JSON.pretty_generate(to_h) end |
#key?(key) ⇒ Boolean
20 21 22 |
# File 'lib/jekyll/minibundle/asset_file_drop.rb', line 20 def key?(key) respond_to?(key) end |
#keys ⇒ Object
24 25 26 |
# File 'lib/jekyll/minibundle/asset_file_drop.rb', line 24 def keys KEYS end |
#to_h ⇒ Object Also known as: to_hash
28 29 30 31 32 |
# File 'lib/jekyll/minibundle/asset_file_drop.rb', line 28 def to_h keys.each_with_object({}) do |key, acc| acc[key] = self[key] end end |