Class: Typedocs::TypeSpec::Value

Inherits:
Typedocs::TypeSpec show all
Defined in:
lib/typedocs/type_spec.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Typedocs::TypeSpec

#error_message_for

Constructor Details

#initialize(val) ⇒ Value

Returns a new instance of Value.



198
199
200
# File 'lib/typedocs/type_spec.rb', line 198

def initialize(val)
  @value = val
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



201
202
203
# File 'lib/typedocs/type_spec.rb', line 201

def value
  @value
end

Instance Method Details

#to_sourceObject



205
206
207
# File 'lib/typedocs/type_spec.rb', line 205

def to_source
  value.inspect
end

#valid?(obj) ⇒ Boolean

Returns:

  • (Boolean)


202
203
204
# File 'lib/typedocs/type_spec.rb', line 202

def valid?(obj)
  obj == value
end