Class: PictureTag::Instructions::HTMLAttributeSet

Inherits:
Object
  • Object
show all
Defined in:
lib/jekyll_picture_tag/instructions/html_attributes.rb

Overview

Handles HTML attributes, sourced from configuration and the liquid tag, sent to various elements. Stored as a hash, with string keys.

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ HTMLAttributeSet

Initialize with leftovers passed into the liquid tag. These leftovers (params) take the form of an array of strings, called words, which the tag parser has separated.



10
11
12
13
14
15
# File 'lib/jekyll_picture_tag/instructions/html_attributes.rb', line 10

def initialize(params)
  @attributes = load_preset

  parse_params(params) if params
  handle_source_url
end

Instance Method Details

#[](key) ⇒ Object



17
18
19
# File 'lib/jekyll_picture_tag/instructions/html_attributes.rb', line 17

def [](key)
  @attributes[key]
end