plivo 0.2.6 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/plivo.rb +5 -16
- data/lib/test.rb +7 -0
- metadata +9 -8
data/lib/plivo.rb
CHANGED
@@ -427,10 +427,10 @@ module Plivo
|
|
427
427
|
@nestables = []
|
428
428
|
@valid_attributes = []
|
429
429
|
|
430
|
-
attr_accessor :
|
430
|
+
attr_accessor :node, :name
|
431
431
|
|
432
432
|
def initialize(body=nil, attributes={})
|
433
|
-
@name =
|
433
|
+
@name = self.class.name.split('::')[1]
|
434
434
|
@body = body
|
435
435
|
@node = REXML::Element.new @name
|
436
436
|
attributes.each do |k, v|
|
@@ -462,6 +462,9 @@ module Plivo
|
|
462
462
|
end
|
463
463
|
|
464
464
|
def add(element)
|
465
|
+
if not element
|
466
|
+
raise PlivoError, "invalid element"
|
467
|
+
end
|
465
468
|
if self.class.nestables.include?(element.name)
|
466
469
|
@node.elements << element.node
|
467
470
|
return element
|
@@ -539,7 +542,6 @@ module Plivo
|
|
539
542
|
|
540
543
|
def initialize()
|
541
544
|
super(nil, {})
|
542
|
-
@name = "Response"
|
543
545
|
end
|
544
546
|
|
545
547
|
def to_xml()
|
@@ -561,7 +563,6 @@ module Plivo
|
|
561
563
|
raise PlivoError, 'No text set for Speak'
|
562
564
|
end
|
563
565
|
super(body, attributes)
|
564
|
-
@name = "Speak"
|
565
566
|
end
|
566
567
|
end
|
567
568
|
|
@@ -575,7 +576,6 @@ module Plivo
|
|
575
576
|
raise PlivoError 'No url set for Play'
|
576
577
|
end
|
577
578
|
super(body, attributes)
|
578
|
-
@name = "Speak"
|
579
579
|
end
|
580
580
|
end
|
581
581
|
|
@@ -586,7 +586,6 @@ module Plivo
|
|
586
586
|
|
587
587
|
def initialize(attributes={})
|
588
588
|
super(nil, attributes)
|
589
|
-
@name = "Wait"
|
590
589
|
end
|
591
590
|
end
|
592
591
|
|
@@ -600,7 +599,6 @@ module Plivo
|
|
600
599
|
raise PlivoError 'No url set for Redirect'
|
601
600
|
end
|
602
601
|
super(body, attributes)
|
603
|
-
@name = "Redirect"
|
604
602
|
end
|
605
603
|
end
|
606
604
|
|
@@ -611,7 +609,6 @@ module Plivo
|
|
611
609
|
|
612
610
|
def initialize(attributes={})
|
613
611
|
super(nil, attributes)
|
614
|
-
@name = "Hangup"
|
615
612
|
end
|
616
613
|
end
|
617
614
|
|
@@ -624,7 +621,6 @@ module Plivo
|
|
624
621
|
|
625
622
|
def initialize(attributes={})
|
626
623
|
super(nil, attributes)
|
627
|
-
@name = "GetDigits"
|
628
624
|
end
|
629
625
|
end
|
630
626
|
|
@@ -638,7 +634,6 @@ module Plivo
|
|
638
634
|
raise PlivoError, 'No number set for Number'
|
639
635
|
end
|
640
636
|
super(body, attributes)
|
641
|
-
@name = "Number"
|
642
637
|
end
|
643
638
|
end
|
644
639
|
|
@@ -652,7 +647,6 @@ module Plivo
|
|
652
647
|
raise PlivoError, 'No user set for User'
|
653
648
|
end
|
654
649
|
super(body, attributes)
|
655
|
-
@name = "User"
|
656
650
|
end
|
657
651
|
end
|
658
652
|
|
@@ -666,7 +660,6 @@ module Plivo
|
|
666
660
|
|
667
661
|
def initialize(attributes={})
|
668
662
|
super(nil, attributes)
|
669
|
-
@name = "Dial"
|
670
663
|
end
|
671
664
|
end
|
672
665
|
|
@@ -685,7 +678,6 @@ module Plivo
|
|
685
678
|
raise PlivoError, 'No conference name set for Conference'
|
686
679
|
end
|
687
680
|
super(body, attributes)
|
688
|
-
@name = "Conference"
|
689
681
|
end
|
690
682
|
end
|
691
683
|
|
@@ -698,7 +690,6 @@ module Plivo
|
|
698
690
|
|
699
691
|
def initialize(attributes={})
|
700
692
|
super(nil, attributes)
|
701
|
-
@name = "Record"
|
702
693
|
end
|
703
694
|
end
|
704
695
|
|
@@ -709,7 +700,6 @@ module Plivo
|
|
709
700
|
|
710
701
|
def initialize(attributes={})
|
711
702
|
super(nil, attributes)
|
712
|
-
@name = "PreAnswer"
|
713
703
|
end
|
714
704
|
end
|
715
705
|
|
@@ -723,7 +713,6 @@ module Plivo
|
|
723
713
|
raise PlivoError, 'No text set for Message'
|
724
714
|
end
|
725
715
|
super(body, attributes)
|
726
|
-
@name = "Message"
|
727
716
|
end
|
728
717
|
end
|
729
718
|
end
|
data/lib/test.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.7
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: builder
|
16
|
-
requirement: &
|
16
|
+
requirement: &13805360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 2.1.2
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *13805360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: rest-client
|
27
|
-
requirement: &
|
27
|
+
requirement: &13804800 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.6.7
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *13804800
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: json
|
38
|
-
requirement: &
|
38
|
+
requirement: &13804160 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ! '>='
|
@@ -43,7 +43,7 @@ dependencies:
|
|
43
43
|
version: 1.6.6
|
44
44
|
type: :runtime
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *13804160
|
47
47
|
description: A Ruby gem for interacting with the Plivo Platform
|
48
48
|
email: support@plivo.com
|
49
49
|
executables: []
|
@@ -51,6 +51,7 @@ extensions: []
|
|
51
51
|
extra_rdoc_files:
|
52
52
|
- README.md
|
53
53
|
files:
|
54
|
+
- lib/test.rb
|
54
55
|
- lib/plivo.rb
|
55
56
|
- README.md
|
56
57
|
homepage: http://www.plivo.com
|