class RADMesh::CADMesh::HashableStruct

FFI::Struct that has to_hash @!visibility private

Public Class Methods

value_to_value(value) click to toggle source

@!visibility private

# File lib/radmesh/cadmesh.rb, line 42
def self.value_to_value(value)
  return value.to_s if value.class == CharArray
  return value.to_a.map(&:to_hash) if value.class == InlineArray
  return value.to_hash if value.class <= HashableStruct
  value
end

Public Instance Methods

to_hash() click to toggle source

@!visibility private

# File lib/radmesh/cadmesh.rb, line 33
def to_hash
  hash = {}
  members.each do |key|
    hash[key] = self.class.value_to_value(self[key])
  end
  hash
end