Class: Mercy::Report

Inherits:
Object
  • Object
show all
Includes:
Arstotzka
Defined in:
lib/mercy/report.rb,
lib/mercy/report/error.rb,
lib/mercy/report/range.rb

Direct Known Subclasses

ActiveRecord

Defined Under Namespace

Modules: Multiple Classes: ActiveRecord, Error, Range

Constant Summary collapse

ALLOWED_PARAMETERS =
[]
DEFAULT_OPTION =
{}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Report

Returns a new instance of Report.



15
16
17
# File 'lib/mercy/report.rb', line 15

def initialize(options = {})
  @json = default_option.merge(options)
end

Instance Attribute Details

#jsonObject (readonly)

Returns the value of attribute json.



11
12
13
# File 'lib/mercy/report.rb', line 11

def json
  @json
end

Instance Method Details

#as_jsonObject



27
28
29
# File 'lib/mercy/report.rb', line 27

def as_json
  { status: status }
end

#error?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'lib/mercy/report.rb', line 23

def error?
  raise 'Not implemented yet'
end

#statusObject



19
20
21
# File 'lib/mercy/report.rb', line 19

def status
  @status ||= error? ? :error : :ok
end