Class: Fable::DivertTargetValue

Inherits:
Value show all
Defined in:
lib/fable/value.rb

Instance Attribute Summary

Attributes inherited from Value

#value_object

Attributes inherited from RuntimeObject

#original_object, #own_debug_metadata, #parent, #path

Instance Method Summary collapse

Methods inherited from Value

#bad_cast_exception, #copy, create

Methods inherited from RuntimeObject

#compact_path_string, #convert_path_to_relative, #copy, #debug_line_number_of_path, #debug_metadata, #indentation_string, #resolve_path, #root_content_container

Constructor Details

#initialize(value = nil) ⇒ DivertTargetValue

Returns a new instance of DivertTargetValue.



204
205
206
# File 'lib/fable/value.rb', line 204

def initialize(value=nil)
  super(value)
end

Instance Method Details

#cast(new_type) ⇒ Object



208
209
210
211
212
213
214
# File 'lib/fable/value.rb', line 208

def cast(new_type)
  if new_type == self.class
    return self
  end

  raise bad_cast_exception(new_type)
end

#to_sObject



216
217
218
# File 'lib/fable/value.rb', line 216

def to_s
  return "DivertTargetValue(#{target_path})"
end

#truthy?Boolean

Returns:

  • (Boolean)

Raises:



200
201
202
# File 'lib/fable/value.rb', line 200

def truthy?
  raise Error, "Shouldn't be checking the truthiness of a divert target"
end

#value_typeObject



196
197
198
# File 'lib/fable/value.rb', line 196

def value_type
  return OrderedValueTypes[DivertTargetValue]
end