1use super::*;
2
3#[derive(Debug, Clone)]
10pub struct Player {
11 strings: Vec<String>,
12}
13
14impl Player {
15 pub fn builder() -> Self {
17 Self {
18 strings: vec![create_card("summary")],
19 }
20 }
21
22 #[inline]
27 pub fn title(mut self, content: &str) -> Self {
28 self.strings.push(create_title(content));
29 self
30 }
31
32 #[inline]
34 pub fn site(mut self, site: &str) -> Self {
35 self.strings.push(create_site(site));
36 self
37 }
38
39 #[inline]
42 pub fn site_id(mut self, content: &str) -> Self {
43 self.strings.push(create_site_id(content));
44 self
45 }
46
47 #[inline]
49 pub fn creator_id(mut self, content: &str) -> Self {
50 self.strings.push(create_creator_id(content));
51 self
52 }
53
54 #[inline]
59 pub fn desc(mut self, content: &str) -> Self {
60 self.strings.push(create_desc(content));
61 self
62 }
63
64 #[inline]
68 pub fn image(mut self, content: &str) -> Self {
69 self.strings.push(create_image(content));
70 self
71 }
72
73 #[inline]
79 pub fn image_alt(mut self, content: &str) -> Self {
80 self.strings.push(create_image_alt(content));
81 self
82 }
83
84 #[inline]
86 pub fn player(mut self, content: &str) -> Self {
87 self.strings.push(create_player(content));
88 self
89 }
90
91 #[inline]
93 pub fn player_width(mut self, content: &str) -> Self {
94 self.strings.push(create_player_width(content));
95 self
96 }
97
98 #[inline]
100 pub fn player_height(mut self, content: &str) -> Self {
101 self.strings.push(create_player_height(content));
102 self
103 }
104
105 #[inline]
107 pub fn player_stream(mut self, content: &str) -> Self {
108 self.strings.push(create_player_stream(content));
109 self
110 }
111}
112
113impl TwitterCard for Player {
114 #[inline]
115 fn build(self) -> String {
116 self.strings.join("\n")
117 }
118}