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