Class: TMS::Errors::InvalidVerb

Inherits:
Object
  • Object
show all
Defined in:
lib/tms_client/errors.rb

Direct Known Subclasses

InvalidDelete, InvalidPost, InvalidPut

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(record_or_string) ⇒ InvalidVerb

Returns a new instance of InvalidVerb.



36
37
38
39
40
41
42
43
44
# File 'lib/tms_client/errors.rb', line 36

def initialize(record_or_string)
  if record_or_string.respond_to?(:href)
    @record = record_or_string
    super("Couldn't POST #{record.class} to #{record.href}: #{record.errors.join(', ')}")
  else
    super(record_or_string)
  end

end

Instance Attribute Details

#recordObject (readonly)

Returns the value of attribute record.



34
35
36
# File 'lib/tms_client/errors.rb', line 34

def record
  @record
end