File tree 2 files changed +3
-3
lines changed
2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -153,7 +153,7 @@ defimpl Sassone.Builder, for: Any do
153
153
unquote ( end_element )
154
154
155
155
def attributes ( _t ) , do: unquote ( Macro . escape ( attributes ) )
156
- def build ( t ) , do: XML . build ( t , Builder . root_element ( t ) )
156
+ def build ( t ) , do: XML . build ( t , Builder . namespace ( t ) , Builder . root_element ( t ) )
157
157
def elements ( _t ) , do: unquote ( Macro . escape ( elements ) )
158
158
def handler ( _t ) , do: __MODULE__
159
159
def namespace ( _t ) , do: unquote ( options [ :namespace ] )
Original file line number Diff line number Diff line change @@ -96,7 +96,7 @@ defmodule Sassone.XML do
96
96
97
97
@ doc "Builds a struct deriving `Sassone.Builder` for encoding with `Sassone.encode!/2`"
98
98
@ spec build ( Builder . t ( ) , name ( ) ) :: element ( )
99
- def build ( struct , element_name ) do
99
+ def build ( struct , namespace \\ nil , element_name ) do
100
100
attributes =
101
101
Builder . attributes ( struct )
102
102
|> Enum . reduce ( [ ] , & build_attributes ( struct , & 1 , & 2 ) )
@@ -107,7 +107,7 @@ defmodule Sassone.XML do
107
107
|> Enum . reduce ( [ ] , & build_elements ( struct , & 1 , & 2 ) )
108
108
|> Enum . reverse ( )
109
109
110
- element ( Builder . namespace ( struct ) , element_name , attributes , elements )
110
+ element ( namespace , element_name , attributes , elements )
111
111
end
112
112
113
113
defp build_attributes ( _struct , % Field { build: false } , attributes ) ,
You can’t perform that action at this time.
0 commit comments