Class: Pakyow::Presenter::Attributes::String

Inherits:
Attribute
  • Object
show all
Extended by:
Forwardable, Support::SafeStringHelpers
Defined in:
lib/pakyow/presenter/attributes/string.rb

Overview

Wraps the value for a string-type view attribute (e.g. href).

Behaves just like a normal String.

Direct Known Subclasses

Boolean

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Attribute

#==, #initialize, #initialize_copy

Constructor Details

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

Class Method Details

.parse(value) ⇒ Object



31
32
33
# File 'lib/pakyow/presenter/attributes/string.rb', line 31

def parse(value)
  new(ensure_html_safety(value.to_s))
end

Instance Method Details

#to_sObject



20
21
22
# File 'lib/pakyow/presenter/attributes/string.rb', line 20

def to_s
  @value
end

#to_strObject



24
25
26
# File 'lib/pakyow/presenter/attributes/string.rb', line 24

def to_str
  to_s
end