Sha256: 97a763006d5ad1f91c5dff309cb1b6b991a9b3fb4c54c736113ba7f4fdf1d8bd

Contents?: true

Size: 383 Bytes

Versions: 7

Compression:

Stored size: 383 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable Style/ClassAndModuleChildren
class Maglev::SettingTypes::Link < Maglev::SettingTypes::Base
  def cast_value(value)
    if value.is_a?(String)
      { text: 'Link', link_type: 'url', href: value }
    else
      { text: 'Link', link_type: 'url', href: '#' }.merge(value)
    end
  end
end
# rubocop:enable Style/ClassAndModuleChildren

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
maglevcms-1.7.2 app/models/maglev/setting_types/link.rb
maglevcms-1.7.1 app/models/maglev/setting_types/link.rb
maglevcms-1.7.0 app/models/maglev/setting_types/link.rb
maglevcms-1.6.1 app/models/maglev/setting_types/link.rb
maglevcms-1.6.0 app/models/maglev/setting_types/link.rb
maglevcms-1.5.1 app/models/maglev/setting_types/link.rb
maglevcms-1.4.0 app/models/maglev/setting_types/link.rb