class Xml2Go::Field
represents member variables
Attributes
name[RW]
type[RW]
value[RW]
xml_tag[RW]
Public Class Methods
new(name, type, xml_tag, value)
click to toggle source
# File lib/xml2go/struct.rb, line 8 def initialize(name, type, xml_tag, value) @name = name @type = type @xml_tag = xml_tag @value = value @const_name = Xml2Go::get_const_name(@name) end
Public Instance Methods
to_const()
click to toggle source
# File lib/xml2go/struct.rb, line 25 def to_const if !value.nil? then return "#{@const_name} = \"#{@value}\"" end return "" end
to_declaration()
click to toggle source
# File lib/xml2go/struct.rb, line 20 def to_declaration value = @value.nil? ? Xml2Go::low(@name) : @const_name "#{@name}: #{value}," end
to_s()
click to toggle source
# File lib/xml2go/struct.rb, line 16 def to_s "#{@name} #{@type} `xml:\"#{@xml_tag}\"`" end