Class: Trek::ContentEditor::Image

Inherits:
Object
  • Object
show all
Extended by:
ActiveModel::Translation
Includes:
ActiveModel::Model, ActiveModel::Validations, ActiveModel::Validations::Callbacks
Defined in:
app/models/trek/content_editor/image.rb

Constant Summary collapse

SIZES =
%i[default larger].freeze

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#altObject

Returns the value of attribute alt.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def alt
  @alt
end

#creditObject

Returns the value of attribute credit.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def credit
  @credit
end

#file_dataObject

Returns the value of attribute file_data.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def file_data
  @file_data
end

#idObject

Returns the value of attribute id.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def id
  @id
end

#sizeObject

Returns the value of attribute size.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def size
  @size
end

#textObject

Returns the value of attribute text.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def text
  @text
end

#turbo_frame_idObject

Returns the value of attribute turbo_frame_id.



11
12
13
# File 'app/models/trek/content_editor/image.rb', line 11

def turbo_frame_id
  @turbo_frame_id
end

Class Method Details

.size_optionsObject



19
20
21
22
23
# File 'app/models/trek/content_editor/image.rb', line 19

def self.size_options
  SIZES.map do |size|
    [I18n.t("activemodel.options.trek/content_editor/image.size.#{size}"), size]
  end
end