Class: Whitebox::Decision
- Inherits:
-
Data
- Object
- Data
- Whitebox::Decision
- Defined in:
- lib/whitebox/models.rb
Instance Attribute Summary collapse
-
#confidence ⇒ Object
readonly
Returns the value of attribute confidence.
-
#cost_usd ⇒ Object
readonly
Returns the value of attribute cost_usd.
-
#created_at ⇒ Object
readonly
Returns the value of attribute created_at.
-
#escalated ⇒ Object
readonly
Returns the value of attribute escalated.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#latency_ms ⇒ Object
readonly
Returns the value of attribute latency_ms.
-
#mode ⇒ Object
readonly
Returns the value of attribute mode.
-
#runs ⇒ Object
readonly
Returns the value of attribute runs.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#value ⇒ Object
readonly
Returns the value of attribute value.
-
#verdict ⇒ Object
readonly
Returns the value of attribute verdict.
Class Method Summary collapse
Instance Method Summary collapse
Instance Attribute Details
#confidence ⇒ Object (readonly)
Returns the value of attribute confidence
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def confidence @confidence end |
#cost_usd ⇒ Object (readonly)
Returns the value of attribute cost_usd
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def cost_usd @cost_usd end |
#created_at ⇒ Object (readonly)
Returns the value of attribute created_at
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def created_at @created_at end |
#escalated ⇒ Object (readonly)
Returns the value of attribute escalated
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def escalated @escalated end |
#id ⇒ Object (readonly)
Returns the value of attribute id
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def id @id end |
#latency_ms ⇒ Object (readonly)
Returns the value of attribute latency_ms
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def latency_ms @latency_ms end |
#mode ⇒ Object (readonly)
Returns the value of attribute mode
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def mode @mode end |
#runs ⇒ Object (readonly)
Returns the value of attribute runs
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def runs @runs end |
#status ⇒ Object (readonly)
Returns the value of attribute status
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def status @status end |
#value ⇒ Object (readonly)
Returns the value of attribute value
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def value @value end |
#verdict ⇒ Object (readonly)
Returns the value of attribute verdict
13 14 15 |
# File 'lib/whitebox/models.rb', line 13 def verdict @verdict end |
Class Method Details
.from_hash(h) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/whitebox/models.rb', line 14 def self.from_hash(h) new( id: h["id"], status: h["status"], value: h["value"], confidence: h["confidence"], verdict: h["verdict"], escalated: h["escalated"], runs: (h["runs"] || []).map { |r| Run.from_hash(r) }, latency_ms: h["latency_ms"], cost_usd: h["cost_usd"], created_at: h["created_at"], mode: h["mode"] ) end |
Instance Method Details
#escalated? ⇒ Boolean
31 |
# File 'lib/whitebox/models.rb', line 31 def escalated? = escalated == true |
#shipped? ⇒ Boolean
30 |
# File 'lib/whitebox/models.rb', line 30 def shipped? = verdict == "ship" |