Class: SpreadsheetBuilder::NoteContentColumn

Inherits:
StringColumn show all
Defined in:
backend/app/model/spreadsheet_builder.rb

Instance Attribute Summary collapse

Attributes inherited from StringColumn

#column, #index, #jsonmodel, #locked, #name, #property_name, #width

Instance Method Summary collapse

Methods inherited from StringColumn

#sanitise_incoming_value, #value_for

Constructor Details

#initialize(jsonmodel, name, note_jsonmodel = 'note_multipart', opts = {}) ⇒ NoteContentColumn

Returns a new instance of NoteContentColumn.



102
103
104
105
# File 'backend/app/model/spreadsheet_builder.rb', line 102

def initialize(jsonmodel, name, note_jsonmodel = 'note_multipart', opts = {})
  super(jsonmodel, name, opts)
  @note_jsonmodel = note_jsonmodel
end

Instance Attribute Details

#note_jsonmodelObject

Returns the value of attribute note_jsonmodel



100
101
102
# File 'backend/app/model/spreadsheet_builder.rb', line 100

def note_jsonmodel
  @note_jsonmodel
end

Instance Method Details

#header_labelObject



107
108
109
# File 'backend/app/model/spreadsheet_builder.rb', line 107

def header_label
  "#{I18n.t('note._singular')} #{I18n.t("enumerations.#{@note_jsonmodel}_type.#{@name}")} - #{index + 1} - Content"
end

#multipart?Boolean

Returns:

  • (Boolean)


115
116
117
# File 'backend/app/model/spreadsheet_builder.rb', line 115

def multipart?
  @note_jsonmodel == 'note_multipart'
end

#pathObject



111
112
113
# File 'backend/app/model/spreadsheet_builder.rb', line 111

def path
  [@jsonmodel.to_s, @name.to_s, @index.to_s, 'content'].join('/')
end