Class: Mandoc::Meta

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

Direct Known Subclasses

ManMeta, MdocMeta

Instance Method Summary collapse

Instance Method Details

#archObject

:call-seq:

arch -> String or nil


183
184
185
186
187
188
# File 'ext/mandoc/rb_mandoc.c', line 183

static VALUE
rb_meta_m_arch (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return meta->arch ? rb_str_new_cstr (meta->arch) : RUBY_Qnil;
}

#dateObject

:call-seq:

date -> String


216
217
218
219
220
221
# File 'ext/mandoc/rb_mandoc.c', line 216

static VALUE
rb_meta_m_date (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_str_new_cstr (meta->date);
}

#deroffObject

:call-seq:

deroff -> String


134
135
136
137
138
139
140
141
142
143
144
# File 'ext/mandoc/rb_mandoc.c', line 134

static VALUE
rb_meta_m_deroff (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  char *text = NULL;
  deroff (&text, meta->first);
  VALUE str
      = rb_str_new_cstr (text); /* user's responsibility to decide encoding */
  free (text);
  return str;
}

#first_nodeObject

:call-seq:

first_node -> Node


428
429
430
431
432
433
# File 'ext/mandoc/rb_mandoc.c', line 428

static VALUE
rb_meta_m_first_node (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_wrap_node (meta->first);
}

#has_body?Boolean

:call-seq:

has_body? -> false or true

Returns:

  • (Boolean)


238
239
240
241
242
243
# File 'ext/mandoc/rb_mandoc.c', line 238

static VALUE
rb_meta_m_has_body (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return meta->hasbody ? RUBY_Qtrue : RUBY_Qfalse;
}

#nameObject

:call-seq:

name -> String


205
206
207
208
209
210
# File 'ext/mandoc/rb_mandoc.c', line 205

static VALUE
rb_meta_m_name (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_str_new_cstr (meta->name);
}

#osObject

:call-seq:

os -> String


172
173
174
175
176
177
# File 'ext/mandoc/rb_mandoc.c', line 172

static VALUE
rb_meta_m_os (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_str_new_cstr (meta->os);
}

#sectionObject

:call-seq:

section -> String


150
151
152
153
154
155
# File 'ext/mandoc/rb_mandoc.c', line 150

static VALUE
rb_meta_m_section (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_str_new_cstr (meta->msec);
}

#so_targetObject

:call-seq:

so_target -> String or nil


227
228
229
230
231
232
# File 'ext/mandoc/rb_mandoc.c', line 227

static VALUE
rb_meta_m_so_target (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return meta->sodest ? rb_str_new_cstr (meta->sodest) : RUBY_Qnil;
}

#titleObject

:call-seq:

title -> String


194
195
196
197
198
199
# File 'ext/mandoc/rb_mandoc.c', line 194

static VALUE
rb_meta_m_title (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_str_new_cstr (meta->title);
}

#volumeObject

:call-seq:

volume -> String


161
162
163
164
165
166
# File 'ext/mandoc/rb_mandoc.c', line 161

static VALUE
rb_meta_m_volume (VALUE self)
{
  struct roff_meta *meta = RTYPEDDATA_DATA (self);
  return rb_str_new_cstr (meta->vol);
}