Class: WithClues::Private::CustomClueMethodAnalysis::Param

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

Instance Method Summary collapse

Constructor Details

#initialize(method_param_array) ⇒ Param

Returns a new instance of Param.



42
43
44
45
46
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 42

def initialize(method_param_array)
  @type = method_param_array[0]
  @name = method_param_array[1]

end

Instance Method Details

#keyword_required?Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 51

def keyword_required?
  @type == :keyreq
end

#nameObject



58
59
60
61
62
63
64
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 58

def name
  if self.keyword_required?
    "#{@name}:"
  else
    @name
  end
end

#named?(*allowed_names) ⇒ Boolean

Returns:

  • (Boolean)


55
56
57
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 55

def named?(*allowed_names)
  allowed_names.include?(@name)
end

#required?Boolean

Returns:

  • (Boolean)


48
49
50
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 48

def required?
  @type == :req
end