Class: DTK::Client::Violation::Fix::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/violation/fix/result.rb,
lib/violation/fix/result/error.rb

Direct Known Subclasses

Error

Defined Under Namespace

Classes: Error

Constant Summary collapse

Types =
[:ok, :error, :skip_current, :skip_all, :error, :rerun_violation_check]

Class Method Summary collapse

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



46
47
48
49
50
51
52
# File 'lib/violation/fix/result.rb', line 46

def method_missing(method, *args)
  if type = is_type_with_question_mark?(method)
    type == @type
  else
    super
  end
end

Class Method Details

.create(type, *args) ⇒ Object



26
27
28
29
30
31
# File 'lib/violation/fix/result.rb', line 26

def self.create(type, *args)
  case type
    when :error then Error.new(*args)
    else new(type)
  end
end

.method_missing(method, *args) ⇒ Object



39
40
41
# File 'lib/violation/fix/result.rb', line 39

def self.method_missing(method, *args)
  is_type?(method) ? create(method, *args) : super
end

.respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/violation/fix/result.rb', line 42

def self.respond_to?(method)
  !!is_type?(method) 
end

Instance Method Details

#respond_to?(method) ⇒ Boolean

Returns:

  • (Boolean)


53
54
55
# File 'lib/violation/fix/result.rb', line 53

def respond_to?(method)
  !!is_type_with_question_mark?(method)
end