Class: Mkxms::Mssql::ResultType

Inherits:
Struct
  • Object
show all
Defined in:
lib/mkxms/mssql/clr_impl.rb

Overview

Used for scalar and result table column type specification

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#capacityObject

Returns the value of attribute capacity

Returns:

  • (Object)

    the current value of capacity



49
50
51
# File 'lib/mkxms/mssql/clr_impl.rb', line 49

def capacity
  @capacity
end

#collationObject

Returns the value of attribute collation

Returns:

  • (Object)

    the current value of collation



49
50
51
# File 'lib/mkxms/mssql/clr_impl.rb', line 49

def collation
  @collation
end

#nameObject

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



49
50
51
# File 'lib/mkxms/mssql/clr_impl.rb', line 49

def name
  @name
end

#precisionObject

Returns the value of attribute precision

Returns:

  • (Object)

    the current value of precision



49
50
51
# File 'lib/mkxms/mssql/clr_impl.rb', line 49

def precision
  @precision
end

#scaleObject

Returns the value of attribute scale

Returns:

  • (Object)

    the current value of scale



49
50
51
# File 'lib/mkxms/mssql/clr_impl.rb', line 49

def scale
  @scale
end

#schemaObject

Returns the value of attribute schema

Returns:

  • (Object)

    the current value of schema



49
50
51
# File 'lib/mkxms/mssql/clr_impl.rb', line 49

def schema
  @schema
end

Instance Method Details

#type_specObject



50
51
52
53
54
55
56
# File 'lib/mkxms/mssql/clr_impl.rb', line 50

def type_spec
  [schema, name].compact.join('.').tap do |result|
    result << "(#{capacity})" if capacity
    result << "(#{[precision, scale].compact.join(', ')})"
    result << " COLLATE #{collation}" if collation
  end
end