1use super::*;
2
3#[derive(Debug, Clone)]
5pub struct Summary {
6 strings: Vec<String>,
7}
8
9impl Summary {
10 pub fn builder() -> Self {
12 Self {
13 strings: vec![create_card("summary")],
14 }
15 }
16
17 #[inline]
19 pub fn site(mut self, site: &str) -> Self {
20 self.strings.push(create_site(site));
21 self
22 }
23
24 #[inline]
27 pub fn site_id(mut self, content: &str) -> Self {
28 self.strings.push(create_site_id(content));
29 self
30 }
31
32 #[inline]
34 pub fn creator_id(mut self, content: &str) -> Self {
35 self.strings.push(create_creator_id(content));
36 self
37 }
38
39 #[inline]
44 pub fn desc(mut self, content: &str) -> Self {
45 self.strings.push(create_desc(content));
46 self
47 }
48
49 #[inline]
54 pub fn title(mut self, content: &str) -> Self {
55 self.strings.push(create_title(content));
56 self
57 }
58
59 #[inline]
63 pub fn image(mut self, content: &str) -> Self {
64 self.strings.push(create_image(content));
65 self
66 }
67
68 #[inline]
74 pub fn image_alt(mut self, content: &str) -> Self {
75 self.strings.push(create_image_alt(content));
76 self
77 }
78}
79
80impl TwitterCard for Summary {
81 #[inline]
82 fn build(self) -> String {
83 self.strings.join("\n")
84 }
85}