Class: Jekyll::HackclubEmoji

Inherits:
Liquid::Tag
  • Object
show all
Defined in:
lib/emoji.rb

Instance Method Summary collapse

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/, '').strip
    @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