Sha256: 1da6a5c5b07fa71adbb8195393d43323e8ecb1be7820a9a4d7b5e1f4d4c42734
Contents?: true
Size: 727 Bytes
Versions: 12
Compression:
Stored size: 727 Bytes
Contents
# frozen_string_literal: true require "forwardable" require "pakyow/support/safe_string" require "pakyow/presenter/attributes/attribute" module Pakyow module Presenter class Attributes # Wraps the value for a string-type view attribute (e.g. href). # # Behaves just like a normal +String+. # class String < Attribute extend Forwardable def_delegators :@value, :empty?, :include? def to_s @value end def to_str to_s end class << self include Support::SafeStringHelpers def parse(value) new(ensure_html_safety(value.to_s)) end end end end end end
Version data entries
12 entries across 12 versions & 1 rubygems