Class: Ro::HTML
- Inherits:
-
ActiveSupport::SafeBuffer
- Object
- String
- ActiveSupport::SafeBuffer
- Ro::HTML
- Defined in:
- lib/ro/html.rb
Constant Summary
Constants inherited from ActiveSupport::SafeBuffer
ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS
Instance Method Summary collapse
- #attributes ⇒ Object
- #front_matter ⇒ Object
- #front_matter=(hash = {}) ⇒ Object
-
#initialize(*args, **kws, &block) ⇒ HTML
constructor
A new instance of HTML.
Methods inherited from ActiveSupport::SafeBuffer
#%, #+, #[], #clone_empty, #concat, #encode_with, #html_safe?, #initialize_copy, #prepend, #safe_concat, #to_param, #to_s
Methods inherited from String
Constructor Details
#initialize(*args, **kws, &block) ⇒ HTML
Returns a new instance of HTML.
5 6 7 8 9 |
# File 'lib/ro/html.rb', line 5 def initialize(*args, **kws, &block) self.front_matter = kws.fetch(:front_matter){ {} } super(args.join) end |
Instance Method Details
#attributes ⇒ Object
19 20 21 |
# File 'lib/ro/html.rb', line 19 def attributes front_matter end |
#front_matter ⇒ Object
11 12 13 |
# File 'lib/ro/html.rb', line 11 def front_matter @front_matter ||= Map.new end |
#front_matter=(hash = {}) ⇒ Object
15 16 17 |
# File 'lib/ro/html.rb', line 15 def front_matter=(hash = {}) @front_matter = Map.for(hash) end |