Class: Webhookdb::Formatting::Table
- Inherits:
-
Object
- Object
- Webhookdb::Formatting::Table
- Defined in:
- lib/webhookdb/formatting.rb
Instance Attribute Summary collapse
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#rows ⇒ Object
Returns the value of attribute rows.
Instance Method Summary collapse
- #as_json(*o) ⇒ Object
-
#initialize(headers, rows) ⇒ Table
constructor
A new instance of Table.
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
#headers ⇒ Object
Returns the value of attribute headers.
45 46 47 |
# File 'lib/webhookdb/formatting.rb', line 45 def headers @headers end |
#rows ⇒ Object
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 |