Class: Allure::JSONable
- Inherits:
-
Object
- Object
- Allure::JSONable
- Defined in:
- lib/allure_ruby_commons/model/01_jsonable.rb
Overview
General jsonable object implementation
Direct Known Subclasses
Attachment, Category, ExecutableItem, Label, Link, Parameter, StatusDetails, TestResultContainer
Instance Method Summary collapse
-
#==(other) ⇒ Booelan
Object comparator.
-
#to_hash ⇒ Hash
Return object hash represantation.
Instance Method Details
#==(other) ⇒ Booelan
Object comparator
23 24 25 |
# File 'lib/allure_ruby_commons/model/01_jsonable.rb', line 23 def ==(other) self.class == other.class && state == other.state end |
#to_hash ⇒ Hash
Return object hash represantation
12 13 14 15 16 17 18 |
# File 'lib/allure_ruby_commons/model/01_jsonable.rb', line 12 def to_hash instance_variables.each_with_object({}) do |var, map| key = camelcase(var.to_s.delete_prefix("@")) value = instance_variable_get(var) map[key] = value unless value.nil? end end |