Class: Odin::Types::PatternConstraint

Inherits:
Object
  • Object
show all
Defined in:
lib/odin/types/schema.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pattern:, message: nil) ⇒ PatternConstraint

Returns a new instance of PatternConstraint.



70
71
72
73
74
75
# File 'lib/odin/types/schema.rb', line 70

def initialize(pattern:, message: nil)
  @kind = :pattern
  @pattern = pattern.freeze
  @message = message&.freeze
  freeze
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



68
69
70
# File 'lib/odin/types/schema.rb', line 68

def kind
  @kind
end

#messageObject (readonly)

Returns the value of attribute message.



68
69
70
# File 'lib/odin/types/schema.rb', line 68

def message
  @message
end

#patternObject (readonly)

Returns the value of attribute pattern.



68
69
70
# File 'lib/odin/types/schema.rb', line 68

def pattern
  @pattern
end