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.



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

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)


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

def success?
  !!@success
end