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.



20
21
22
23
24
25
26
27
28
# File 'lib/tms_client/errors.rb', line 20

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.



18
19
20
# File 'lib/tms_client/errors.rb', line 18

def record
  @record
end