Sha256: e916c4fd08a3a56ebfa90ffdd928a77b01f47235767164e9b27c26932c3644a5

Contents?: true

Size: 525 Bytes

Versions: 25

Compression:

Stored size: 525 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Style/ClassAndModuleChildren
class Maglev::Theme::SectionCategory
  ## concerns ##
  include ActiveModel::Model

  ## attributes ##
  attr_accessor :name, :id

  ## class methods ##

  def self.build(hash)
    attributes = hash.slice('name', 'id')
    attributes['id'] ||= attributes['name'].parameterize(separator: '_')
    new(attributes)
  end

  def self.build_many(list)
    (list || []).map { |hash| build(hash) }
  end
end
# rubocop:enable Style/ClassAndModuleChildren

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
maglevcms-1.8.0 app/models/maglev/theme/section_category.rb
maglevcms-1.7.3 app/models/maglev/theme/section_category.rb
maglevcms-1.7.2 app/models/maglev/theme/section_category.rb
maglevcms-1.7.1 app/models/maglev/theme/section_category.rb
maglevcms-1.7.0 app/models/maglev/theme/section_category.rb
maglevcms-1.6.1 app/models/maglev/theme/section_category.rb
maglevcms-1.6.0 app/models/maglev/theme/section_category.rb
maglevcms-1.5.1 app/models/maglev/theme/section_category.rb
maglevcms-1.4.0 app/models/maglev/theme/section_category.rb
maglevcms-1.3.0 app/models/maglev/theme/section_category.rb
maglevcms-1.2.2 app/models/maglev/theme/section_category.rb
maglevcms-1.2.1 app/models/maglev/theme/section_category.rb
maglevcms-1.2.0 app/models/maglev/theme/section_category.rb
maglevcms-1.1.7 app/models/maglev/theme/section_category.rb
maglevcms-1.1.6 app/models/maglev/theme/section_category.rb
maglevcms-1.1.5 app/models/maglev/theme/section_category.rb
maglevcms-1.1.4 app/models/maglev/theme/section_category.rb
maglevcms-1.1.3 app/models/maglev/theme/section_category.rb
maglevcms-1.1.2 app/models/maglev/theme/section_category.rb
maglevcms-1.1.1 app/models/maglev/theme/section_category.rb