Class: Mandoc::Node

Inherits:
Object
  • Object
show all
Defined in:
ext/mandoc/rb_mandoc.c

Instance Method Summary collapse

Instance Method Details

#bodyObject

:call-seq:

body -> Node or nil


524
525
526
527
528
529
# File 'ext/mandoc/rb_mandoc.c', line 524

static VALUE
rb_node_m_body (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->body ? rb_wrap_node (node->body) : RUBY_Qnil;
}

#columnObject

:call-seq:

column -> Integer


579
580
581
582
583
584
# File 'ext/mandoc/rb_mandoc.c', line 579

static VALUE
rb_node_m_column (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return rb_int2num_inline (node->pos);
}

#first_childObject

:call-seq:

first_child -> Node or nil


469
470
471
472
473
474
# File 'ext/mandoc/rb_mandoc.c', line 469

static VALUE
rb_node_m_first_child (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->child ? rb_wrap_node (node->child) : RUBY_Qnil;
}

#headObject

:call-seq:

head -> Node or nil


513
514
515
516
517
518
# File 'ext/mandoc/rb_mandoc.c', line 513

static VALUE
rb_node_m_head (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->head ? rb_wrap_node (node->head) : RUBY_Qnil;
}

#last_childObject

:call-seq:

last_child -> Node or nil


480
481
482
483
484
485
# File 'ext/mandoc/rb_mandoc.c', line 480

static VALUE
rb_node_m_last_child (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->last ? rb_wrap_node (node->last) : RUBY_Qnil;
}

#lineObject

:call-seq:

line -> Integer


568
569
570
571
572
573
# File 'ext/mandoc/rb_mandoc.c', line 568

static VALUE
rb_node_m_line (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return rb_int2num_inline (node->line);
}

#nameObject

:call-seq:

name -> String


590
591
592
593
594
595
# File 'ext/mandoc/rb_mandoc.c', line 590

static VALUE
rb_node_m_name (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return rb_usascii_str_new_cstr (roff_name[node->tok]);
}

#next_siblingObject

:call-seq:

next_sibling -> Node or nil


491
492
493
494
495
496
# File 'ext/mandoc/rb_mandoc.c', line 491

static VALUE
rb_node_m_next_sibling (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->next ? rb_wrap_node (node->next) : RUBY_Qnil;
}

#parentObject

:call-seq:

parent -> Node or nil


458
459
460
461
462
463
# File 'ext/mandoc/rb_mandoc.c', line 458

static VALUE
rb_node_m_parent (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->parent ? rb_wrap_node (node->parent) : RUBY_Qnil;
}

#prev_siblingObject

:call-seq:

prev_sibling -> Node or nil


502
503
504
505
506
507
# File 'ext/mandoc/rb_mandoc.c', line 502

static VALUE
rb_node_m_prev_sibling (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->prev ? rb_wrap_node (node->prev) : RUBY_Qnil;
}

#tagObject

:call-seq:

tag -> String or nil


557
558
559
560
561
562
# File 'ext/mandoc/rb_mandoc.c', line 557

static VALUE
rb_node_m_tag (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->string ? rb_str_new_cstr (node->tag) : RUBY_Qnil;
}

#tailObject

:call-seq:

tail -> Node or nil


535
536
537
538
539
540
# File 'ext/mandoc/rb_mandoc.c', line 535

static VALUE
rb_node_m_tail (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->tail ? rb_wrap_node (node->tail) : RUBY_Qnil;
}

#textObject

:call-seq:

text -> String or nil


546
547
548
549
550
551
# File 'ext/mandoc/rb_mandoc.c', line 546

static VALUE
rb_node_m_text (VALUE self)
{
  struct roff_node *node = RTYPEDDATA_DATA (self);
  return node->string ? rb_str_new_cstr (node->string) : RUBY_Qnil;
}