lib/ronin/sql/field.rb in ronin-sql-1.0.0 vs lib/ronin/sql/field.rb in ronin-sql-1.1.0
- old
+ new
@@ -19,19 +19,23 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
require 'ronin/sql/operators'
+require 'ronin/sql/emittable'
module Ronin
module SQL
#
# Represents a SQL column, table or database name.
#
+ # @api semipublic
+ #
class Field < Struct.new(:name,:parent)
include Operators
+ include Emittable
#
# Initializes the new field.
#
# @param [String] name
@@ -57,21 +61,9 @@
field = nil
names.each { |name| field = new(name,field) }
return field
- end
-
- #
- # Converts the field to a String.
- #
- # @return [String]
- # The full field name.
- #
- def to_s
- if parent then "#{parent}.#{name}"
- else name.to_s
- end
end
alias to_str to_s
protected