Class: Webhookdb::Formatting::Table

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(headers, rows) ⇒ Table

Returns a new instance of Table.



47
48
49
50
# File 'lib/webhookdb/formatting.rb', line 47

def initialize(headers, rows)
  @headers = headers
  @rows = rows
end

Instance Attribute Details

#headersObject

Returns the value of attribute headers.



45
46
47
# File 'lib/webhookdb/formatting.rb', line 45

def headers
  @headers
end

#rowsObject

Returns the value of attribute rows.



45
46
47
# File 'lib/webhookdb/formatting.rb', line 45

def rows
  @rows
end

Instance Method Details

#as_json(*o) ⇒ Object



52
53
54
# File 'lib/webhookdb/formatting.rb', line 52

def as_json(*o)
  return {type: "table", value: {headers: self.headers, rows: self.rows.as_json(*o)}}
end