Class: Cadenya::Types::ToolSetAdapter_StringMatcher_Regex

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type: nil, regex: nil, case_sensitive: nil) ⇒ ToolSetAdapter_StringMatcher_Regex

Returns a new instance of ToolSetAdapter_StringMatcher_Regex.



8143
8144
8145
8146
8147
# File 'lib/cadenya/types.rb', line 8143

def initialize(type: nil, regex: nil, case_sensitive: nil)
  @type = type
  @regex = regex
  @case_sensitive = case_sensitive
end

Instance Attribute Details

#case_sensitiveObject (readonly)

Returns the value of attribute case_sensitive.



8141
8142
8143
# File 'lib/cadenya/types.rb', line 8141

def case_sensitive
  @case_sensitive
end

#regexObject (readonly)

Returns the value of attribute regex.



8141
8142
8143
# File 'lib/cadenya/types.rb', line 8141

def regex
  @regex
end

#typeObject (readonly)

Returns the value of attribute type.



8141
8142
8143
# File 'lib/cadenya/types.rb', line 8141

def type
  @type
end

Class Method Details

.from_json(data) ⇒ Object



8149
8150
8151
8152
8153
8154
8155
# File 'lib/cadenya/types.rb', line 8149

def self.from_json(data)
  new(
    type: data["type"],
    regex: data["regex"],
    case_sensitive: data["caseSensitive"],
  )
end

Instance Method Details

#to_hObject



8157
8158
8159
8160
8161
8162
8163
# File 'lib/cadenya/types.rb', line 8157

def to_h
  {
    type: Util.plain(@type),
    regex: Util.plain(@regex),
    case_sensitive: Util.plain(@case_sensitive),
  }.reject { |_k, v| v.nil? }
end