Class: SqlChatbot::Grammar::Entity
- Inherits:
-
Struct
- Object
- Struct
- SqlChatbot::Grammar::Entity
- Defined in:
- lib/sql_chatbot/grammar/registry.rb
Instance Attribute Summary collapse
-
#associations ⇒ Object
Returns the value of attribute associations.
-
#display_label ⇒ Object
Returns the value of attribute display_label.
-
#fields ⇒ Object
Returns the value of attribute fields.
-
#implicit_filters ⇒ Object
Returns the value of attribute implicit_filters.
-
#name ⇒ Object
Returns the value of attribute name.
-
#primary_key ⇒ Object
Returns the value of attribute primary_key.
-
#ranking_candidates ⇒ Object
Returns the value of attribute ranking_candidates.
-
#row_count ⇒ Object
Returns the value of attribute row_count.
-
#scopes ⇒ Object
Returns the value of attribute scopes.
-
#table ⇒ Object
Returns the value of attribute table.
-
#timestamps ⇒ Object
Returns the value of attribute timestamps.
Instance Method Summary collapse
-
#initialize(**kwargs) ⇒ Entity
constructor
A new instance of Entity.
Constructor Details
#initialize(**kwargs) ⇒ Entity
Returns a new instance of Entity.
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 11 def initialize(**kwargs) super( name: kwargs[:name], table: kwargs[:table], display_label: kwargs[:display_label] || kwargs[:name]&.capitalize, row_count: kwargs[:row_count] || 0, primary_key: kwargs[:primary_key] || "id", timestamps: kwargs[:timestamps] || {}, fields: kwargs[:fields] || {}, scopes: kwargs[:scopes] || {}, associations: kwargs[:associations] || {}, ranking_candidates: kwargs[:ranking_candidates] || [], implicit_filters: kwargs[:implicit_filters] || [] ) end |
Instance Attribute Details
#associations ⇒ Object
Returns the value of attribute associations
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def associations @associations end |
#display_label ⇒ Object
Returns the value of attribute display_label
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def display_label @display_label end |
#fields ⇒ Object
Returns the value of attribute fields
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def fields @fields end |
#implicit_filters ⇒ Object
Returns the value of attribute implicit_filters
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def implicit_filters @implicit_filters end |
#name ⇒ Object
Returns the value of attribute name
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def name @name end |
#primary_key ⇒ Object
Returns the value of attribute primary_key
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def primary_key @primary_key end |
#ranking_candidates ⇒ Object
Returns the value of attribute ranking_candidates
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def ranking_candidates @ranking_candidates end |
#row_count ⇒ Object
Returns the value of attribute row_count
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def row_count @row_count end |
#scopes ⇒ Object
Returns the value of attribute scopes
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def scopes @scopes end |
#table ⇒ Object
Returns the value of attribute table
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def table @table end |
#timestamps ⇒ Object
Returns the value of attribute timestamps
7 8 9 |
# File 'lib/sql_chatbot/grammar/registry.rb', line 7 def @timestamps end |