Class: WithClues::Private::CustomClueMethodAnalysis::Param
- Inherits:
-
Object
- Object
- WithClues::Private::CustomClueMethodAnalysis::Param
- Defined in:
- lib/with_clues/private/custom_clue_method_analysis.rb
Instance Method Summary collapse
-
#initialize(method_param_array) ⇒ Param
constructor
A new instance of Param.
- #keyword_required? ⇒ Boolean
- #name ⇒ Object
- #named?(*allowed_names) ⇒ Boolean
- #required? ⇒ Boolean
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
51 52 53 |
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 51 def keyword_required? @type == :keyreq end |
#name ⇒ Object
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
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
48 49 50 |
# File 'lib/with_clues/private/custom_clue_method_analysis.rb', line 48 def required? @type == :req end |