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
- #build_type ⇒ Object
-
#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
#build_type ⇒ Object
12 13 14 |
# File 'lib/types/private/types/string_holder.rb', line 12 def build_type nil end |
#name ⇒ Object
overrides Base
17 18 19 |
# File 'lib/types/private/types/string_holder.rb', line 17 def name string end |
#valid?(obj) ⇒ Boolean
overrides Base
22 23 24 |
# File 'lib/types/private/types/string_holder.rb', line 22 def valid?(obj) false end |