Class: ForemanMaintain::Utils::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(success, message, data: {}) ⇒ Response

Returns a new instance of Response.



6
7
8
9
10
# File 'lib/foreman_maintain/utils/response.rb', line 6

def initialize(success, message, data: {})
  @success = success
  @message = message
  @data = data
end

Instance Attribute Details

#dataObject (readonly)

Returns the value of attribute data.



4
5
6
# File 'lib/foreman_maintain/utils/response.rb', line 4

def data
  @data
end

#messageObject (readonly)

Returns the value of attribute message.



4
5
6
# File 'lib/foreman_maintain/utils/response.rb', line 4

def message
  @message
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/foreman_maintain/utils/response.rb', line 12

def success?
  !!@success
end