Class: Jekyll::WebmentionIO::Config::SyndicationRule

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(entry) ⇒ SyndicationRule

Returns a new instance of SyndicationRule.



243
244
245
246
247
248
249
250
251
252
253
254
255
256
# File 'lib/jekyll/config.rb', line 243

def initialize(entry)
  @endpoint = entry['endpoint']
  @shorturl = entry['shorturl']
  @fragment = entry['fragment']
  @response_mapping = {}

  return unless entry.key?('response_mapping')

  entry['response_mapping'].each do |key, pattern|
    @response_mapping[key] = JsonPath.new(pattern)
  rescue StandardError => e
    WebmentionIO.log 'error', "Ignoring invalid JsonPath expression #{pattern}: #{e}"
  end
end

Instance Attribute Details

#endpointObject (readonly)

Returns the value of attribute endpoint.



241
242
243
# File 'lib/jekyll/config.rb', line 241

def endpoint
  @endpoint
end

#fragmentObject (readonly)

Returns the value of attribute fragment.



241
242
243
# File 'lib/jekyll/config.rb', line 241

def fragment
  @fragment
end

#response_mappingObject (readonly)

Returns the value of attribute response_mapping.



241
242
243
# File 'lib/jekyll/config.rb', line 241

def response_mapping
  @response_mapping
end

#shorturlObject (readonly)

Returns the value of attribute shorturl.



241
242
243
# File 'lib/jekyll/config.rb', line 241

def shorturl
  @shorturl
end