Class: BridgetownAvatar::Builder
- Inherits:
-
Bridgetown::Builder
- Object
- Bridgetown::Builder
- BridgetownAvatar::Builder
- Defined in:
- lib/bridgetown-avatar/builder.rb
Constant Summary collapse
- DEFAULT_SIZE =
"40"- API_VERSION =
"3"- SERVERS =
4
Instance Attribute Summary collapse
-
#size ⇒ Object
readonly
Returns the value of attribute size.
Instance Method Summary collapse
Instance Attribute Details
#size ⇒ Object (readonly)
Returns the value of attribute size.
11 12 13 |
# File 'lib/bridgetown-avatar/builder.rb', line 11 def size @size end |
Instance Method Details
#build ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/bridgetown-avatar/builder.rb', line 13 def build liquid_tag "avatar" do |attributes, tag| @attributes = attributes # .split(",").map(&:strip) @size = compute_size @context = tag.context "<img src=\"#{url}\" class=\"#{classes}\"/>" end end |