Class: Travis::Lint::DSL::Validator

Inherits:
Struct
  • Object
show all
Defined in:
lib/travis/lint/validator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#keyObject

Returns the value of attribute key

Returns:

  • (Object)

    the current value of key



4
5
6
# File 'lib/travis/lint/validator.rb', line 4

def key
  @key
end

#languageObject

Returns the value of attribute language

Returns:

  • (Object)

    the current value of language



4
5
6
# File 'lib/travis/lint/validator.rb', line 4

def language
  @language
end

#messageObject

Returns the value of attribute message

Returns:

  • (Object)

    the current value of message



4
5
6
# File 'lib/travis/lint/validator.rb', line 4

def message
  @message
end

#validatorObject

Returns the value of attribute validator

Returns:

  • (Object)

    the current value of validator



4
5
6
# File 'lib/travis/lint/validator.rb', line 4

def validator
  @validator
end

Instance Method Details

#call(hash) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/travis/lint/validator.rb', line 5

def call(hash)
  if self.validator.call(hash)
    [false, { :key => self.key, :issue => self.message }]
  else
    [true, {}]
  end
end