lib/stylegen/generator.rb in stylegen-0.1.0 vs lib/stylegen/generator.rb in stylegen-0.2.0
- old
+ new
@@ -18,10 +18,14 @@
generate_struct
generate_colors
generate_extensions
end
+ def stats
+ @stats ||= { output_path: @data.output_path, color_count: @data.colors.count }
+ end
+
private
def generate_header
out "//"
out "// #{@data.basename}"
@@ -87,10 +91,10 @@
def generate_colors
out "#{@data.access_level} extension #{@data.struct_name} {"
out ""
- @data.colors do |member, color|
+ @data.colors.each do |member, color|
out " static let #{member} = #{color.to_s(@data.struct_name, 4)}"
out ""
end
out "}"