Class: WithClues::Private::CustomClueMethodAnalysis::TwoArgMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/with_clues/private/custom_clue_method_analysis.rb

Direct Known Subclasses

FourArgMethod

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ TwoArgMethod

Returns a new instance of TwoArgMethod.



74
75
76
77
78
79
80
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 74

def initialize(params)
  @errors = []
  if !params[0].required?
    @errors << "Param 1, #{params[0].name}, is not required"
  end
  require_keyword(2,params[1])
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



73
74
75
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 73

def errors
  @errors
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


82
83
84
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 82

def valid?
  @errors.empty?
end