Class: Webhookdb::Formatting::Blocks
- Inherits:
-
Object
- Object
- Webhookdb::Formatting::Blocks
- Defined in:
- lib/webhookdb/formatting.rb
Instance Method Summary collapse
- #as_json(*a) ⇒ Object
- #blank ⇒ Object
-
#initialize ⇒ Blocks
constructor
A new instance of Blocks.
- #line(value) ⇒ Object
- #table(headers, rows) ⇒ Object
Constructor Details
#initialize ⇒ Blocks
Returns a new instance of Blocks.
9 10 11 |
# File 'lib/webhookdb/formatting.rb', line 9 def initialize @arr = [] end |
Instance Method Details
#as_json(*a) ⇒ Object
27 28 29 |
# File 'lib/webhookdb/formatting.rb', line 27 def as_json(*a) return @arr.as_json(*a) end |
#blank ⇒ Object
13 14 15 |
# File 'lib/webhookdb/formatting.rb', line 13 def blank return self.line("") end |
#line(value) ⇒ Object
17 18 19 20 |
# File 'lib/webhookdb/formatting.rb', line 17 def line(value) @arr << Line.new(value) return self end |
#table(headers, rows) ⇒ Object
22 23 24 25 |
# File 'lib/webhookdb/formatting.rb', line 22 def table(headers, rows) @arr << Table.new(headers, rows) return self end |