Exception: RemoteResource::ApiReadOnlyMethod

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

Instance Method Summary collapse

Constructor Details

#initialize(method_name) ⇒ ApiReadOnlyMethod

Returns a new instance of ApiReadOnlyMethod.



7
8
9
10
# File 'lib/remote_resource/errors.rb', line 7

def initialize(method_name)
  @method_name = method_name
  super(message)
end

Instance Method Details

#messageObject



12
13
14
15
16
17
18
19
20
21
# File 'lib/remote_resource/errors.rb', line 12

def message
  "\n    The `RemoteResource` gem creates read only methods which represent\n    API values. `\#{@method_name}` was defined using this gem and this error\n    is raised to indicate that these attributes are read only, although you\n    may override this behavior by defining a `\#{@method_name}=` setter\n    method on this class.\n  MESSAGE\nend\n".strip_heredoc