lib/money_s3/builders/vlajky.rb in money_s3-0.4.0 vs lib/money_s3/builders/vlajky.rb in money_s3-0.5.0
- old
+ new
@@ -4,16 +4,19 @@
module MoneyS3
module Builders
class Vlajky
include BaseBuilder
- attr_accessor :global, :user
-
def builder
root = Ox::Element.new(element_name)
- root << VlajkaType.new(global, 'Global').builder if global
- root << VlajkaType.new(user, 'User').builder if user
+ if attributes.key? :global
+ root << VlajkaType.new(attributes[:global], 'Global').builder
+ end
+
+ if attributes.key? :user
+ root << VlajkaType.new(attributes[:user], 'User').builder
+ end
root
end
end
end
\ No newline at end of file