Class: Pakyow::Presenter::Attributes::Boolean

Inherits:
String show all
Defined in:
lib/pakyow/presenter/attributes/boolean.rb

Overview

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.

Method Summary

Methods inherited from String

parse, #to_s, #to_str

Methods inherited from Attribute

#==, #initialize, #initialize_copy

Constructor Details

This class inherits a constructor from Pakyow::Presenter::Attributes::Attribute