class SocialRails::Helpers::Tag

Public Class Methods

new(template, content, scope, config) click to toggle source
# File lib/social_rails/helpers/tag.rb, line 4
def initialize(template, content, scope, config)
  @template, @content, @scope, @config, @options = template, content, scope, config
end

Public Instance Methods

partial_path() click to toggle source
# File lib/social_rails/helpers/tag.rb, line 12
def partial_path
  [
    "social_rails",
    @scope,
    self.class.name.demodulize.underscore
  ].compact.join("/")
end
to_s(locals = {}) click to toggle source
# File lib/social_rails/helpers/tag.rb, line 8
def to_s(locals = {})
  @template.render partial: partial_path, locals: locals
end
truncate(the_content) click to toggle source
# File lib/social_rails/helpers/tag.rb, line 20
def truncate(the_content)
  the_content.truncate(@config.public[:max_characters], separator: ' ')
end