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

Instance Method Summary collapse

Methods included from Textable

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

Methods inherited from SirTrevorRails::Block

#as_json, block_class, block_class!, custom_block_types, #format, from_hash, #initialize, #to_partial_path, type_klass

Constructor Details

This class inherits a constructor from SirTrevorRails::Block

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)


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

def zpr_link?
  zpr_link == 'true'
end