Module: Locomotive::Liquid::Filters::Text

Defined in:
lib/locomotive/liquid/filters/text.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) concat(input, *args)



23
24
25
26
27
# File 'lib/locomotive/liquid/filters/text.rb', line 23

def concat(input, *args)
  result = input.to_s
  args.flatten.each { |a| result << a.to_s }
  result
end

- (Object) dasherize(input)



10
11
12
# File 'lib/locomotive/liquid/filters/text.rb', line 10

def dasherize(input)
  input.to_s.gsub(' ', '-').gsub('/', '-').dasherize
end

- (Object) encode(input)



14
15
16
# File 'lib/locomotive/liquid/filters/text.rb', line 14

def encode(input)
  Rack::Utils.escape(input)
end

- (Object) ljust(input, integer, padstr = '')

left justify and padd a string



35
36
37
# File 'lib/locomotive/liquid/filters/text.rb', line 35

def ljust(input, integer, padstr = '')
  input.to_s.ljust(integer, padstr)
end

- (Object) markdown(input)



43
44
45
# File 'lib/locomotive/liquid/filters/text.rb', line 43

def markdown(input)
  Locomotive::Markdown.render(input)
end

- (Object) multi_line(input)

alias newline_to_br



19
20
21
# File 'lib/locomotive/liquid/filters/text.rb', line 19

def multi_line(input)
  input.to_s.gsub("\n", '<br/>')
end

- (Object) rjust(input, integer, padstr = '')

right justify and padd a string



30
31
32
# File 'lib/locomotive/liquid/filters/text.rb', line 30

def rjust(input, integer, padstr = '')
  input.to_s.rjust(integer, padstr)
end

- (Object) textile(input)



39
40
41
# File 'lib/locomotive/liquid/filters/text.rb', line 39

def textile(input)
  ::RedCloth.new(input).to_html
end

- (Object) underscore(input)



6
7
8
# File 'lib/locomotive/liquid/filters/text.rb', line 6

def underscore(input)
  input.to_s.gsub(' ', '_').gsub('/', '_').underscore
end