Module: SirTrevorRails::Blocks::Textable

Included in:
OembedBlock, SolrDocumentsBlock, UploadedItemsBlock
Defined in:
app/models/sir_trevor_rails/blocks/textable.rb

Overview

Mixin for blocks that display text

Instance Method Summary collapse

Instance Method Details

#content_alignObject



14
15
16
17
18
# File 'app/models/sir_trevor_rails/blocks/textable.rb', line 14

def content_align
  return unless text?

  text_align == 'left' ? 'right' : 'left'
end

#textObject



20
21
22
23
24
25
# File 'app/models/sir_trevor_rails/blocks/textable.rb', line 20

def text
  val = super

  # empty, in sir-trevor speak
  val unless val == '<p><br></p>'
end

#text?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/models/sir_trevor_rails/blocks/textable.rb', line 6

def text?
  text.present?
end

#text_alignObject



10
11
12
# File 'app/models/sir_trevor_rails/blocks/textable.rb', line 10

def text_align
  send(:'text-align')
end