Class: SirTrevorRails::Blocks::UploadedItemsBlock

Inherits:
SirTrevorRails::Block show all
Includes:
Textable
Defined in:
app/models/sir_trevor_rails/blocks/uploaded_items_block.rb

Overview

Uploaded images with text

Constant Summary

Constants inherited from SirTrevorRails::Block

SirTrevorRails::Block::DEFAULT_FORMAT

Instance Attribute Summary

Attributes inherited from SirTrevorRails::Block

#parent, #type

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Textable

#content_align, #text, #text?, #text_align

Methods inherited from SirTrevorRails::Block

#alt_text?, #as_json, block_class, block_class!, custom_block_type_alt_text_settings, custom_block_types, #format, from_hash, #initialize, #to_partial_path, type_klass

Constructor Details

This class inherits a constructor from SirTrevorRails::Block

Class Method Details

.alt_text?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'app/models/sir_trevor_rails/blocks/uploaded_items_block.rb', line 15

def self.alt_text?
  true
end

Instance Method Details

#filesObject



11
12
13
# File 'app/models/sir_trevor_rails/blocks/uploaded_items_block.rb', line 11

def files
  (item || {}).map { |_, file| file }.select { |file| file[:display].to_s == 'true' }
end

#zpr_link?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'app/models/sir_trevor_rails/blocks/uploaded_items_block.rb', line 19

def zpr_link?
  zpr_link == 'true'
end