Class: PuzzlyApiPlugin::TableView
- Inherits:
-
Renderable
- Object
- Hash
- JSONable
- Renderable
- PuzzlyApiPlugin::TableView
- Defined in:
- lib/puzzly_api_plugin/view/table.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(mod, table) ⇒ TableView
constructor
A new instance of TableView.
Methods inherited from Renderable
#apis, #caches, #contexts, #modules, #path, #queries, #render, #schemas, #tables, #topics
Methods inherited from JSONable
Constructor Details
#initialize(mod, table) ⇒ TableView
Returns a new instance of TableView.
12 13 14 15 16 17 |
# File 'lib/puzzly_api_plugin/view/table.rb', line 12 def initialize(mod, table) table.copy_to_hash self self.delete MetadataFields::MODULE_ID self[MetadataFields::MODULE] = mod end |
Class Method Details
.create(table) ⇒ Object
5 6 7 8 9 10 |
# File 'lib/puzzly_api_plugin/view/table.rb', line 5 def self.create(table) mod = ModulesCollection.instance.get_by_id table.module_id TableView.new(mod.to_identity, table) end |