Class: Locomotive::Mounter::Models::ContentSelectOption

Inherits:
Base
  • Object
show all
Defined in:
lib/locomotive/mounter/models/content_select_option.rb

Instance Attribute Summary

Attributes inherited from Base

#_id, #created_at, #mounting_point, #updated_at

Instance Method Summary collapse

Methods inherited from Base

#initialize, #persisted?

Methods included from Fields

#[], #attributes, #attributes_with_translations, #initialize, #localized_field?, #to_hash, #to_yaml, #translated_in, #translated_in?, #write_attributes

Constructor Details

This class inherits a constructor from Locomotive::Mounter::Models::Base

Instance Method Details

#nameObject

fields ##



8
# File 'lib/locomotive/mounter/models/content_select_option.rb', line 8

field :name,      localized: true

#to_params(options = nil) ⇒ Hash

Return the params used for the API.

Parameters:

  • options (Hash) (defaults to: nil)

    For now, none

Returns:

  • (Hash)

    The params



19
20
21
22
23
# File 'lib/locomotive/mounter/models/content_select_option.rb', line 19

def to_params(options = nil)
  { name: self.name_translations, position: self.position }.tap do |params|
    params[:id] = self._id if self.persisted?
  end
end