Class: MySportsFeeds::Response::Error

Inherits:
Object
  • Object
show all
Defined in:
lib/mysportsfeeds/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(error, status = 422) ⇒ Error

Returns a new instance of Error.



19
20
21
22
# File 'lib/mysportsfeeds/response.rb', line 19

def initialize(error, status = 422)
  @error  = error
  @status = status
end

Instance Attribute Details

#statusObject (readonly)

Returns the value of attribute status.



17
18
19
# File 'lib/mysportsfeeds/response.rb', line 17

def status
  @status
end

Instance Method Details

#bodyObject



24
25
26
# File 'lib/mysportsfeeds/response.rb', line 24

def body
  { error: @error }
end

#success?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'lib/mysportsfeeds/response.rb', line 28

def success?
  false
end