class XmlConv::Model::Name

Attributes

first[R]
last[R]
text[R]

Public Instance Methods

first=(arg) click to toggle source
# File lib/xmlconv/model/name.rb, line 8
def first=(arg)
        set_attr('@first', arg && arg.strip)
end
last=(arg) click to toggle source
# File lib/xmlconv/model/name.rb, line 11
def last=(arg)
        set_attr('@last', arg && arg.strip)
end
text=(arg) click to toggle source
# File lib/xmlconv/model/name.rb, line 14
def text=(arg)
        set_attr('@text', arg && arg.strip)
end
to_s() click to toggle source
# File lib/xmlconv/model/name.rb, line 17
def to_s
        [@first, @text, @last].compact.join(' ')
end

Private Instance Methods

set_attr(attr, arg) click to toggle source
# File lib/xmlconv/model/name.rb, line 21
def set_attr(attr, arg)
        str = arg.to_s
        instance_variable_set(attr, str.empty? ? nil : str)
end