Class: Jekyll::Converters::CookWare

Inherits:
ToHTML
  • Object
show all
Defined in:
lib/jekyll/converters/cooklang.rb

Instance Method Summary collapse

Methods inherited from ToHTML

#to_list_item

Constructor Details

#initialize(quantity, name) ⇒ CookWare

Returns a new instance of CookWare.



48
49
50
51
# File 'lib/jekyll/converters/cooklang.rb', line 48

def initialize(quantity, name)
  @name = name.to_s
  @quantity = quantity.to_s
end

Instance Method Details

#to_htmlObject



53
54
55
56
# File 'lib/jekyll/converters/cooklang.rb', line 53

def to_html
  return @name.to_s if @quantity.empty?
  "<em>#{@quantity}</em> #{@name}"
end