class Organismo::Element::Quote

Attributes

content[R]
location[R]

Public Class Methods

new(text, location) click to toggle source
# File lib/organismo/element/quote.rb, line 5
def initialize(text, location)
  @content = text_without_wrapper(text)
  @location = location
end

Public Instance Methods

convert_to_html() click to toggle source
# File lib/organismo/element/quote.rb, line 10
def convert_to_html
  "<blockquote>#{content_with_p_tag}</blockquote>"
end

Private Instance Methods

content_with_p_tag() click to toggle source
# File lib/organismo/element/quote.rb, line 20
def content_with_p_tag
  content.split("\n").map { |c| "<p>#{c}</p>" }.join('')
end
text_without_wrapper(text) click to toggle source
# File lib/organismo/element/quote.rb, line 16
def text_without_wrapper(text)
  text.split("\n")[1..-2].join("\n")
end