Class: Skype::Call
- Inherits:
-
Object
- Object
- Skype::Call
- Defined in:
- lib/skype/wrappers/call.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#time ⇒ Object
readonly
Returns the value of attribute time.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #hangup ⇒ Object
-
#initialize(id) ⇒ Call
constructor
A new instance of Call.
- #status ⇒ Object
- #talking? ⇒ Boolean
Constructor Details
#initialize(id) ⇒ Call
Returns a new instance of Call.
11 12 13 14 15 |
# File 'lib/skype/wrappers/call.rb', line 11 def initialize(id) @id = id.to_i @time = Time.at ::Skype.exec("GET CALL #{id} TIMESTAMP").split(/\s/).last.to_i @to = ::Skype.exec("GET CALL #{id} PARTNER_HANDLE").scan(/PARTNER_HANDLE (.+)$/)[0][0] rescue @to = "" end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/skype/wrappers/call.rb', line 9 def id @id end |
#time ⇒ Object (readonly)
Returns the value of attribute time.
9 10 11 |
# File 'lib/skype/wrappers/call.rb', line 9 def time @time end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
9 10 11 |
# File 'lib/skype/wrappers/call.rb', line 9 def to @to end |
Instance Method Details
#hangup ⇒ Object
29 30 31 |
# File 'lib/skype/wrappers/call.rb', line 29 def hangup ::Skype.exec "ALTER CALL #{@id} HANGUP" end |
#status ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/skype/wrappers/call.rb', line 17 def status begin return ::Skype.exec("GET CALL #{@id} STATUS", :response_filter => false).scan(/([A-Z]+)$/)[0][0].downcase.to_sym rescue return :api_error end end |
#talking? ⇒ Boolean
25 26 27 |
# File 'lib/skype/wrappers/call.rb', line 25 def talking? status == :inprogress end |