Class: Arrolio::Content::ParagraphBuilder
- Inherits:
-
Object
- Object
- Arrolio::Content::ParagraphBuilder
- Defined in:
- lib/arrolio/content/builder.rb
Instance Method Summary collapse
- #em(str) ⇒ Object
-
#initialize ⇒ ParagraphBuilder
constructor
A new instance of ParagraphBuilder.
- #link(str, href) ⇒ Object
- #runs {|_self| ... } ⇒ Object
- #strong(str) ⇒ Object
- #text(str, style_id: :inline) ⇒ Object
Constructor Details
#initialize ⇒ ParagraphBuilder
Returns a new instance of ParagraphBuilder.
81 82 83 |
# File 'lib/arrolio/content/builder.rb', line 81 def initialize @runs = [] end |
Instance Method Details
#em(str) ⇒ Object
93 94 95 |
# File 'lib/arrolio/content/builder.rb', line 93 def em(str) @runs << InlineRun.new(str.to_s, style_id: :em) end |
#link(str, href) ⇒ Object
97 98 99 |
# File 'lib/arrolio/content/builder.rb', line 97 def link(str, href) @runs << InlineRun.new(str.to_s, style_id: :link, href: href) end |
#runs {|_self| ... } ⇒ Object
101 102 103 104 105 |
# File 'lib/arrolio/content/builder.rb', line 101 def runs return @runs unless block_given? yield self @runs end |