Class: SmsRu::Call
- Inherits:
-
Object
- Object
- SmsRu::Call
- Defined in:
- lib/sms_ru/data.rb
Overview
Result of SmsRu#call (flash call). ‘code` is the last 4 digits of the number that calls the user — what they read off the incoming call and enter.
Instance Attribute Summary collapse
-
#balance ⇒ Float
readonly
The account balance after the call.
-
#call_id ⇒ String
readonly
The call id assigned by SMS.ru.
-
#code ⇒ String
readonly
The 4-digit code (the calling number’s last 4 digits).
-
#cost ⇒ Float
readonly
The price of the call.
Class Method Summary collapse
Instance Attribute Details
#balance ⇒ Float (readonly)
Returns the account balance after the call.
168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/sms_ru/data.rb', line 168 class Call < Data.define(:code, :call_id, :cost, :balance) # @param hash [Hash] the parsed /code/call response # @return [SmsRu::Call] def self.build(hash) new( code: Coerce.string(hash["code"]), call_id: Coerce.string(hash["call_id"]), cost: Coerce.float(hash["cost"]), balance: Coerce.float(hash["balance"]) ) end end |
#call_id ⇒ String (readonly)
Returns the call id assigned by SMS.ru.
168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/sms_ru/data.rb', line 168 class Call < Data.define(:code, :call_id, :cost, :balance) # @param hash [Hash] the parsed /code/call response # @return [SmsRu::Call] def self.build(hash) new( code: Coerce.string(hash["code"]), call_id: Coerce.string(hash["call_id"]), cost: Coerce.float(hash["cost"]), balance: Coerce.float(hash["balance"]) ) end end |
#code ⇒ String (readonly)
Returns the 4-digit code (the calling number’s last 4 digits).
168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/sms_ru/data.rb', line 168 class Call < Data.define(:code, :call_id, :cost, :balance) # @param hash [Hash] the parsed /code/call response # @return [SmsRu::Call] def self.build(hash) new( code: Coerce.string(hash["code"]), call_id: Coerce.string(hash["call_id"]), cost: Coerce.float(hash["cost"]), balance: Coerce.float(hash["balance"]) ) end end |
#cost ⇒ Float (readonly)
Returns the price of the call.
168 169 170 171 172 173 174 175 176 177 178 179 |
# File 'lib/sms_ru/data.rb', line 168 class Call < Data.define(:code, :call_id, :cost, :balance) # @param hash [Hash] the parsed /code/call response # @return [SmsRu::Call] def self.build(hash) new( code: Coerce.string(hash["code"]), call_id: Coerce.string(hash["call_id"]), cost: Coerce.float(hash["cost"]), balance: Coerce.float(hash["balance"]) ) end end |