Class: TreeHaver::AdapterInfo

Inherits:
Struct
  • Object
show all
Defined in:
lib/tree_haver/contracts.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#backendObject

Returns the value of attribute backend

Returns:

  • (Object)

    the current value of backend



20
21
22
# File 'lib/tree_haver/contracts.rb', line 20

def backend
  @backend
end

#backend_refObject

Returns the value of attribute backend_ref

Returns:

  • (Object)

    the current value of backend_ref



20
21
22
# File 'lib/tree_haver/contracts.rb', line 20

def backend_ref
  @backend_ref
end

#supported_policiesObject

Returns the value of attribute supported_policies

Returns:

  • (Object)

    the current value of supported_policies



20
21
22
# File 'lib/tree_haver/contracts.rb', line 20

def supported_policies
  @supported_policies
end

#supports_dialectsObject

Returns the value of attribute supports_dialects

Returns:

  • (Object)

    the current value of supports_dialects



20
21
22
# File 'lib/tree_haver/contracts.rb', line 20

def supports_dialects
  @supports_dialects
end

Instance Method Details

#to_hObject



21
22
23
24
25
26
27
28
# File 'lib/tree_haver/contracts.rb', line 21

def to_h
  {
    backend: backend,
    **(backend_ref ? { backend_ref: backend_ref.to_h } : {}),
    supports_dialects: supports_dialects,
    supported_policies: deep_dup(supported_policies || [])
  }
end