Class: Oso::Polar::UserType

Inherits:
Object
  • Object
show all
Defined in:
lib/oso/polar/host.rb

Overview

For holding type metadata: name, fields, etc.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name:, klass:, id:, fields:, build_query:, combine_query:, exec_query:) ⇒ UserType

rubocop:disable Metrics/ParameterLists



43
44
45
46
47
48
49
50
51
52
# File 'lib/oso/polar/host.rb', line 43

def initialize(name:, klass:, id:, fields:, build_query:, combine_query:, exec_query:) # rubocop:disable Metrics/ParameterLists
  @name = name
  @klass = klass
  @id = id
  # accept symbol keys
  @fields = fields.each_with_object({}) { |kv, o| o[kv[0].to_s] = kv[1] }
  @build_query = build_query
  @combine_query = combine_query
  @exec_query = exec_query
end

Instance Attribute Details

#build_queryObject (readonly)

Returns the value of attribute build_query.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def build_query
  @build_query
end

#combine_queryObject (readonly)

Returns the value of attribute combine_query.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def combine_query
  @combine_query
end

#exec_queryObject (readonly)

Returns the value of attribute exec_query.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def exec_query
  @exec_query
end

#fieldsObject (readonly)

Returns the value of attribute fields.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def fields
  @fields
end

#idObject (readonly)

Returns the value of attribute id.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def id
  @id
end

#klassObject (readonly)

Returns the value of attribute klass.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def klass
  @klass
end

#nameObject (readonly)

Returns the value of attribute name.



41
42
43
# File 'lib/oso/polar/host.rb', line 41

def name
  @name
end