Class: Mercy::Report
- Inherits:
-
Object
- Object
- Mercy::Report
- Includes:
- Arstotzka
- Defined in:
- lib/mercy/report.rb,
lib/mercy/report/error.rb,
lib/mercy/report/range.rb
Direct Known Subclasses
Defined Under Namespace
Modules: Multiple Classes: ActiveRecord, Error, Range
Constant Summary collapse
- ALLOWED_PARAMETERS =
[]
- DEFAULT_OPTION =
{}
Instance Attribute Summary collapse
-
#json ⇒ Object
readonly
Returns the value of attribute json.
Instance Method Summary collapse
- #as_json ⇒ Object
- #error? ⇒ Boolean
-
#initialize(options = {}) ⇒ Report
constructor
A new instance of Report.
- #status ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Report
Returns a new instance of Report.
15 16 17 |
# File 'lib/mercy/report.rb', line 15 def initialize( = {}) @json = default_option.merge() end |
Instance Attribute Details
#json ⇒ Object (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_json ⇒ Object
27 28 29 |
# File 'lib/mercy/report.rb', line 27 def as_json { status: status } end |
#error? ⇒ Boolean
23 24 25 |
# File 'lib/mercy/report.rb', line 23 def error? raise 'Not implemented yet' end |
#status ⇒ Object
19 20 21 |
# File 'lib/mercy/report.rb', line 19 def status @status ||= error? ? :error : :ok end |