Class: Remitmd::Stream
Instance Attribute Summary collapse
-
#closed_at ⇒ Object
readonly
Returns the value of attribute closed_at.
-
#deposited ⇒ Object
readonly
Returns the value of attribute deposited.
-
#ends_at ⇒ Object
readonly
Returns the value of attribute ends_at.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#max_duration ⇒ Object
readonly
Returns the value of attribute max_duration.
-
#max_total ⇒ Object
readonly
Returns the value of attribute max_total.
-
#payee ⇒ Object
(also: #recipient)
readonly
Returns the value of attribute payee.
-
#payer ⇒ Object
(also: #sender)
readonly
Returns the value of attribute payer.
-
#rate_per_second ⇒ Object
(also: #rate_per_sec)
readonly
Returns the value of attribute rate_per_second.
-
#started_at ⇒ Object
readonly
Returns the value of attribute started_at.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#total_streamed ⇒ Object
(also: #withdrawn)
readonly
Returns the value of attribute total_streamed.
Instance Method Summary collapse
-
#initialize(attrs) ⇒ Stream
constructor
A new instance of Stream.
Methods inherited from Model
Constructor Details
#initialize(attrs) ⇒ Stream
Returns a new instance of Stream.
252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
# File 'lib/remitmd/models.rb', line 252 def initialize(attrs) h = attrs.transform_keys(&:to_s) @id = h["id"] @payer = h["payer"] || h["sender"] @payee = h["payee"] || h["recipient"] @rate_per_second = decimal(h["rate_per_second"] || h["rate_per_sec"]) @deposited = decimal(h["deposited"]) @total_streamed = decimal(h["total_streamed"] || h["withdrawn"] || "0") @max_duration = h["max_duration"] @max_total = decimal(h["max_total"]) @status = h["status"] @started_at = parse_time(h["started_at"]) @ends_at = parse_time(h["ends_at"]) @closed_at = parse_time(h["closed_at"]) end |
Instance Attribute Details
#closed_at ⇒ Object (readonly)
Returns the value of attribute closed_at.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def closed_at @closed_at end |
#deposited ⇒ Object (readonly)
Returns the value of attribute deposited.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def deposited @deposited end |
#ends_at ⇒ Object (readonly)
Returns the value of attribute ends_at.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def ends_at @ends_at end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def id @id end |
#max_duration ⇒ Object (readonly)
Returns the value of attribute max_duration.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def max_duration @max_duration end |
#max_total ⇒ Object (readonly)
Returns the value of attribute max_total.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def max_total @max_total end |
#payee ⇒ Object (readonly) Also known as: recipient
Returns the value of attribute payee.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def payee @payee end |
#payer ⇒ Object (readonly) Also known as: sender
Returns the value of attribute payer.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def payer @payer end |
#rate_per_second ⇒ Object (readonly) Also known as: rate_per_sec
Returns the value of attribute rate_per_second.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def rate_per_second @rate_per_second end |
#started_at ⇒ Object (readonly)
Returns the value of attribute started_at.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def started_at @started_at end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def status @status end |
#total_streamed ⇒ Object (readonly) Also known as: withdrawn
Returns the value of attribute total_streamed.
268 269 270 |
# File 'lib/remitmd/models.rb', line 268 def total_streamed @total_streamed end |