Class: Contraction::Parser::ParamLine
- Defined in:
- lib/parser/lines.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Attributes inherited from TypedLine
#contract, #message, #type, #types
Instance Method Summary collapse
- #contract_message(value, method_name = nil) ⇒ Object
-
#initialize(args = {}) ⇒ ParamLine
constructor
A new instance of ParamLine.
Methods inherited from TypedLine
#evaluate_in_context, #parse_type, #valid?
Constructor Details
#initialize(args = {}) ⇒ ParamLine
Returns a new instance of ParamLine.
44 45 46 47 |
# File 'lib/parser/lines.rb', line 44 def initialize(args={}) super @name = args[:name] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
42 43 44 |
# File 'lib/parser/lines.rb', line 42 def name @name end |
Instance Method Details
#contract_message(value, method_name = nil) ⇒ Object
49 50 51 |
# File 'lib/parser/lines.rb', line 49 def (value, method_name=nil) "#{name} (#{}) must fullfill #{contract.inspect}, but is #{value.inspect}" end |