Class: PrefixedExtension
- Inherits:
-
Object
- Object
- PrefixedExtension
- Defined in:
- lib/flickrup/ext/prefixed_extension.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(config) ⇒ PrefixedExtension
constructor
A new instance of PrefixedExtension.
- #values(prefix_key, ctx) ⇒ Object
Constructor Details
#initialize(config) ⇒ PrefixedExtension
Returns a new instance of PrefixedExtension.
2 3 4 |
# File 'lib/flickrup/ext/prefixed_extension.rb', line 2 def initialize(config) @config = config end |
Instance Method Details
#values(prefix_key, ctx) ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/flickrup/ext/prefixed_extension.rb', line 6 def values(prefix_key, ctx) prefix = @config[prefix_key] if prefix = ctx.file. (, ) = .partition do |x| x.start_with?("#{prefix}") end .map do |x| x[(prefix.length)..x.length] end else [] end end |