Class: T::Private::Types::StringHolder
- Inherits:
-
Types::Base
- Object
- Types::Base
- T::Private::Types::StringHolder
- Defined in:
- lib/types/private/types/string_holder.rb
Overview
Holds a string. Useful for showing type aliases in error messages
Instance Attribute Summary collapse
-
#string ⇒ Object
readonly
Returns the value of attribute string.
Instance Method Summary collapse
-
#initialize(string) ⇒ StringHolder
constructor
A new instance of StringHolder.
-
#name ⇒ Object
overrides Base.
-
#valid?(obj) ⇒ Boolean
overrides Base.
Methods inherited from Types::Base
#==, #describe_obj, #error_message_for_obj, #error_message_for_obj_recursive, #hash, method_added, #recursively_valid?, #subtype_of?, #to_s, #validate!
Constructor Details
#initialize(string) ⇒ StringHolder
Returns a new instance of StringHolder.
8 9 10 |
# File 'lib/types/private/types/string_holder.rb', line 8 def initialize(string) @string = string end |
Instance Attribute Details
#string ⇒ Object (readonly)
Returns the value of attribute string.
6 7 8 |
# File 'lib/types/private/types/string_holder.rb', line 6 def string @string end |
Instance Method Details
#name ⇒ Object
overrides Base
13 14 15 |
# File 'lib/types/private/types/string_holder.rb', line 13 def name string end |
#valid?(obj) ⇒ Boolean
overrides Base
18 19 20 |
# File 'lib/types/private/types/string_holder.rb', line 18 def valid?(obj) false end |