Class: RNV::DataTypeLibrary

Inherits:
Object
  • Object
show all
Defined in:
lib/rnv/data_type_library.rb,
ext/rnv/ruby_rnv.c

Overview

Datatype library callback object

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#documentRNV::Document (readonly)

document in which library is registered

Returns:

Instance Method Details

#allows(typ, ps, s) ⇒ Boolean

Parameters:

  • typ (String)

    the data type

  • ps (String)
  • s (String)

    the value

Returns:

  • (Boolean)


17
18
19
# File 'lib/rnv/data_type_library.rb', line 17

def allows(typ, ps, s)
  true
end

#equal(typ, val, s) ⇒ Boolean

Parameters:

  • typ (String)

    the data type

  • val (String)
  • s (String)

Returns:

  • (Boolean)


9
10
11
# File 'lib/rnv/data_type_library.rb', line 9

def equal(typ, val, s)
  true
end

#push_error(r_msg) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'ext/rnv/ruby_rnv.c', line 10

VALUE rb_datatype_push_error(VALUE self, VALUE r_msg)
{
  document_t *document;
  VALUE r_doc = rb_iv_get(self, "@document");
  Data_Get_Struct(r_doc, document_t, document);

  Check_Type(r_msg, T_STRING);

  if(document->rnv->verror_handler)
    document->rnv->verror_handler((void *)r_doc, ERBIT_DTL, RSTRING_PTR(r_msg), NULL);

  return Qnil;
}