Class: Clickwrap::Presenter::Fragment

Inherits:
Data
  • Object
show all
Defined in:
lib/clickwrap/presenter.rb

Overview

One statement's share of a composed sentence, already split around the place its documents go. Kept as parts rather than a template with a placeholder so a view can drop real links into the middle of a sentence without ever concatenating HTML into translated text.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#documentsObject (readonly)

Returns the value of attribute documents

Returns:

  • (Object)

    the current value of documents



43
44
45
# File 'lib/clickwrap/presenter.rb', line 43

def documents
  @documents
end

#documents_joinerObject (readonly)

Returns the value of attribute documents_joiner

Returns:

  • (Object)

    the current value of documents_joiner



43
44
45
# File 'lib/clickwrap/presenter.rb', line 43

def documents_joiner
  @documents_joiner
end

#kindObject (readonly)

Returns the value of attribute kind

Returns:

  • (Object)

    the current value of kind



43
44
45
# File 'lib/clickwrap/presenter.rb', line 43

def kind
  @kind
end

#prefixObject (readonly)

Returns the value of attribute prefix

Returns:

  • (Object)

    the current value of prefix



43
44
45
# File 'lib/clickwrap/presenter.rb', line 43

def prefix
  @prefix
end

#statement_keyObject (readonly)

Returns the value of attribute statement_key

Returns:

  • (Object)

    the current value of statement_key



43
44
45
# File 'lib/clickwrap/presenter.rb', line 43

def statement_key
  @statement_key
end

#suffixObject (readonly)

Returns the value of attribute suffix

Returns:

  • (Object)

    the current value of suffix



43
44
45
# File 'lib/clickwrap/presenter.rb', line 43

def suffix
  @suffix
end

Instance Method Details

#to_textObject



44
# File 'lib/clickwrap/presenter.rb', line 44

def to_text = "#{prefix}#{documents.map(&:label).join(documents_joiner)}#{suffix}"