Sha256: 925dbe9321e79aed81abc64ddf23b87d63ac7f5a55a0709e29d89685c56e5a78

Contents?: true

Size: 597 Bytes

Versions: 10

Compression:

Stored size: 597 Bytes

Contents

# frozen_string_literal: true

require "pakyow/presenter/attributes/string"

module Pakyow
  module Presenter
    class Attributes
      # Boolean is an odd attribute, since we ultimately want it to behave in this way:
      #
      #   view.attrs[:checked] = true
      #   => <input checked="checked" ...>
      #
      #   view.attrs[:checked] = false
      #   => <input ...>
      #
      # To support this, +Attributes+ manages setting / removing the value on the
      # underlying object; all we do is behave like a String.
      #
      class Boolean < String
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
pakyow-presenter-1.0.6 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.5 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.4 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.3 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.2 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.1 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.0 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.0.rc5 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.0.rc4 lib/pakyow/presenter/attributes/boolean.rb
pakyow-presenter-1.0.0.rc3 lib/pakyow/presenter/attributes/boolean.rb