Class: SlackValidBlockKit::Validator::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/slack_valid_block_kit/validator/error.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(kind, option = nil) ⇒ Error

Returns a new instance of Error.



4
5
6
7
# File 'lib/slack_valid_block_kit/validator/error.rb', line 4

def initialize(kind, option = nil)
  @kind = kind
  @option = option
end

Instance Attribute Details

#kindObject (readonly)

Returns the value of attribute kind.



3
4
5
# File 'lib/slack_valid_block_kit/validator/error.rb', line 3

def kind
  @kind
end

#optionObject (readonly)

Returns the value of attribute option.



3
4
5
# File 'lib/slack_valid_block_kit/validator/error.rb', line 3

def option
  @option
end

Class Method Details

.messages(errors_by_path) ⇒ Object



9
10
11
12
13
# File 'lib/slack_valid_block_kit/validator/error.rb', line 9

def self.messages(errors_by_path)
  errors_by_path.map { |path, errors|
    errors.map { |e| "#{path} : #{e.kind}" }
  }.flatten
end