Class: Webhookdb::Formatting::Blocks

Inherits:
Object
  • Object
show all
Defined in:
lib/webhookdb/formatting.rb

Instance Method Summary collapse

Constructor Details

#initializeBlocks

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

#blankObject



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