module CloudQuery class Field attr_accessor :name, :type, :usage def initialize(name, type) @name, @type = name, type end def to_node(builder) builder.field attributes end private def attributes hash = { :name => @name, :type => @type } hash[:usage] = @usage unless @usage.nil? hash end end end