Class: Rigor::RbsExtended::PredicateEffect

Inherits:
Data
  • Object
show all
Defined in:
lib/rigor/rbs_extended.rb

Overview

Returned for ‘predicate-if-true` / `predicate-if-false`. `target_kind` is `:parameter` (with `target_name` the Ruby parameter symbol) or `:self`. `negative` is true when the directive uses the `~ClassName` form, in which case the engine narrows AWAY from `class_name` (`Narrowing.narrow_not_class`) instead of toward it.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#class_nameObject (readonly)

Returns the value of attribute class_name

Returns:

  • (Object)

    the current value of class_name



52
53
54
# File 'lib/rigor/rbs_extended.rb', line 52

def class_name
  @class_name
end

#edgeObject (readonly)

Returns the value of attribute edge

Returns:

  • (Object)

    the current value of edge



52
53
54
# File 'lib/rigor/rbs_extended.rb', line 52

def edge
  @edge
end

#negativeObject (readonly)

Returns the value of attribute negative

Returns:

  • (Object)

    the current value of negative



52
53
54
# File 'lib/rigor/rbs_extended.rb', line 52

def negative
  @negative
end

#target_kindObject (readonly)

Returns the value of attribute target_kind

Returns:

  • (Object)

    the current value of target_kind



52
53
54
# File 'lib/rigor/rbs_extended.rb', line 52

def target_kind
  @target_kind
end

#target_nameObject (readonly)

Returns the value of attribute target_name

Returns:

  • (Object)

    the current value of target_name



52
53
54
# File 'lib/rigor/rbs_extended.rb', line 52

def target_name
  @target_name
end

Instance Method Details

#falsey_only?Boolean

Returns:

  • (Boolean)


54
# File 'lib/rigor/rbs_extended.rb', line 54

def falsey_only? = edge == :falsey_only

#negative?Boolean

Returns:

  • (Boolean)


55
# File 'lib/rigor/rbs_extended.rb', line 55

def negative? = negative == true

#truthy_only?Boolean

Returns:

  • (Boolean)


53
# File 'lib/rigor/rbs_extended.rb', line 53

def truthy_only? = edge == :truthy_only