Class: Jekyll::HackclubEmoji
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Jekyll::HackclubEmoji
- Defined in:
- lib/emoji.rb
Instance Method Summary collapse
-
#initialize(tagName, content, tokens) ⇒ HackclubEmoji
constructor
A new instance of HackclubEmoji.
- #render(context) ⇒ Object
Constructor Details
#initialize(tagName, content, tokens) ⇒ HackclubEmoji
Returns a new instance of HackclubEmoji.
6 7 8 9 10 |
# File 'lib/emoji.rb', line 6 def initialize(tagName, content, tokens) super @id = content.gsub(/\A:+|:+\z/, '') @img_url = HackclubRequest.resolve_emoji(@id) end |
Instance Method Details
#render(context) ⇒ Object
12 13 14 |
# File 'lib/emoji.rb', line 12 def render(context) %Q{<img src="#{@img_url}" title=":#{@id}:" alt=":#{@id}:" class="hackclub-emoji">} end |