Class: Contraction::Parser::ParamLine

Inherits:
TypedLine
  • Object
show all
Defined in:
lib/parser/lines.rb

Instance Attribute Summary collapse

Attributes inherited from TypedLine

#contract, #message, #type, #types

Instance Method Summary collapse

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

#nameObject (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 contract_message(value, method_name=nil)
  "#{name} (#{message}) must fullfill #{contract.inspect}, but is #{value.inspect}"
end