Class: Ro::HTML

Inherits:
ActiveSupport::SafeBuffer show all
Defined in:
lib/ro/html.rb

Constant Summary

Constants inherited from ActiveSupport::SafeBuffer

ActiveSupport::SafeBuffer::UNSAFE_STRING_METHODS

Instance Method Summary collapse

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

#html_safe

Constructor Details

#initialize(*args, **kws, &block) ⇒ 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

#attributesObject



19
20
21
# File 'lib/ro/html.rb', line 19

def attributes
  front_matter
end

#front_matterObject



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