Class: FalseClass

Inherits:
Object
  • Object
show all
Defined in:
src/object.c

Instance Method Summary collapse

Instance Method Details

#&(obj) ⇒ false #&(obj) ⇒ false

And—Returns false. obj is always evaluated as it is the argument to a method call—there is no short-circuit evaluation in this case.

Overloads:

  • #&(obj) ⇒ false

    Returns:

    • (false)
  • #&(obj) ⇒ false

    Returns:

    • (false)


201
202
203
204
205
# File 'src/object.c', line 201

static mrb_value
false_and(mrb_state *mrb, mrb_value obj)
{
  return mrb_false_value();
}

#^(obj) ⇒ Boolean #^(obj) ⇒ Boolean

Exclusive Or—If obj is nil or false, returns false; otherwise, returns true.

Overloads:

  • #^(obj) ⇒ Boolean

    Returns:

    • (Boolean)
  • #^(obj) ⇒ Boolean

    Returns:

    • (Boolean)


220
221
222
223
224
225
226
227
# File 'src/object.c', line 220

static mrb_value
false_xor(mrb_state *mrb, mrb_value obj)
{
  mrb_bool obj2;

  mrb_get_args(mrb, "b", &obj2);
  return mrb_bool_value(obj2);
}

#to_sObject

‘nuf said…



257
258
259
260
261
# File 'src/object.c', line 257

static mrb_value
false_to_s(mrb_state *mrb, mrb_value obj)
{
  return mrb_str_new_lit_frozen(mrb, "false");
}

#to_sObject

‘nuf said…



257
258
259
260
261
# File 'src/object.c', line 257

static mrb_value
false_to_s(mrb_state *mrb, mrb_value obj)
{
  return mrb_str_new_lit_frozen(mrb, "false");
}

#|(obj) ⇒ Boolean #|(obj) ⇒ Boolean

Or—Returns false if obj is nil or false; true otherwise.

Overloads:

  • #|(obj) ⇒ Boolean

    Returns:

    • (Boolean)
  • #|(obj) ⇒ Boolean

    Returns:

    • (Boolean)


240
241
242
243
244
245
246
247
# File 'src/object.c', line 240

static mrb_value
false_or(mrb_state *mrb, mrb_value obj)
{
  mrb_bool obj2;

  mrb_get_args(mrb, "b", &obj2);
  return mrb_bool_value(obj2);
}