Class: CodeToQuery::Context::Pack

Inherits:
Object
  • Object
show all
Defined in:
lib/code_to_query/context/pack.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(schema:, models:, glossary:, policies:, hints:) ⇒ Pack

Returns a new instance of Pack.



13
14
15
16
17
18
19
# File 'lib/code_to_query/context/pack.rb', line 13

def initialize(schema:, models:, glossary:, policies:, hints:)
  @schema = schema
  @models = models
  @glossary = glossary
  @policies = policies
  @hints = hints
end

Instance Attribute Details

#glossaryObject (readonly)

Returns the value of attribute glossary.



11
12
13
# File 'lib/code_to_query/context/pack.rb', line 11

def glossary
  @glossary
end

#hintsObject (readonly)

Returns the value of attribute hints.



11
12
13
# File 'lib/code_to_query/context/pack.rb', line 11

def hints
  @hints
end

#modelsObject (readonly)

Returns the value of attribute models.



11
12
13
# File 'lib/code_to_query/context/pack.rb', line 11

def models
  @models
end

#policiesObject (readonly)

Returns the value of attribute policies.



11
12
13
# File 'lib/code_to_query/context/pack.rb', line 11

def policies
  @policies
end

#schemaObject (readonly)

Returns the value of attribute schema.



11
12
13
# File 'lib/code_to_query/context/pack.rb', line 11

def schema
  @schema
end

Instance Method Details

#to_hObject



21
22
23
24
25
26
27
28
29
# File 'lib/code_to_query/context/pack.rb', line 21

def to_h
  {
    schema: @schema,
    models: @models,
    glossary: @glossary,
    policies: @policies,
    hints: @hints
  }
end

#to_json(*args) ⇒ Object



31
32
33
# File 'lib/code_to_query/context/pack.rb', line 31

def to_json(*args)
  JSON.pretty_generate(to_h, *args)
end