class Yoda::Model::Types::ValueType
Constants
- VALUE_REGEXP
Attributes
value[R]
Public Class Methods
new(value)
click to toggle source
@param value [String]
# File lib/yoda/model/types/value_type.rb, line 10 def initialize(value) @value = value end
Public Instance Methods
change_root(paths)
click to toggle source
@param paths [Array<Path>] @return [self]
# File lib/yoda/model/types/value_type.rb, line 26 def change_root(paths) self end
eql?(another)
click to toggle source
@param another [Object]
# File lib/yoda/model/types/value_type.rb, line 15 def eql?(another) another.is_a?(ValueType) && value == another.value end
hash()
click to toggle source
# File lib/yoda/model/types/value_type.rb, line 20 def hash [self.class.name, value].hash end
resolve(registry)
click to toggle source
@param registry [Registry] @return [Array<YARD::CodeObjects::Base>]
# File lib/yoda/model/types/value_type.rb, line 32 def resolve(registry) [Store::Query::FindConstant.new(registry).find(value_class)].compact end
to_s()
click to toggle source
@return [String]
# File lib/yoda/model/types/value_type.rb, line 52 def to_s value end
value_class()
click to toggle source
# File lib/yoda/model/types/value_type.rb, line 36 def value_class case value when 'true' '::TrueClass' when 'false' '::FalseClass' when 'nil' '::NilClass' when /\A\d+\Z/ '::Numeric' else nil end end