Class: FruitToLime::Tag
- Inherits:
-
Object
- Object
- FruitToLime::Tag
- Defined in:
- lib/fruit_to_lime/model/tag.rb
Instance Attribute Summary collapse
-
#value ⇒ Object
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(val = nil) ⇒ Tag
constructor
A new instance of Tag.
- #serialize_name ⇒ Object
- #to_s ⇒ Object
- #to_xml ⇒ Object
Constructor Details
#initialize(val = nil) ⇒ Tag
Returns a new instance of Tag.
10 11 12 13 14 |
# File 'lib/fruit_to_lime/model/tag.rb', line 10 def initialize(val=nil) if val @value = val end end |
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
8 9 10 |
# File 'lib/fruit_to_lime/model/tag.rb', line 8 def value @value end |
Instance Method Details
#==(other) ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/fruit_to_lime/model/tag.rb', line 25 def ==(other) if other.respond_to?(:value) return @value == other.value else return false end end |
#serialize_name ⇒ Object
4 5 6 |
# File 'lib/fruit_to_lime/model/tag.rb', line 4 def serialize_name "Tag" end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/fruit_to_lime/model/tag.rb', line 21 def to_s return "tag: '#{@value}'" end |
#to_xml ⇒ Object
16 17 18 19 |
# File 'lib/fruit_to_lime/model/tag.rb', line 16 def to_xml varn = serialize_name "<#{varn}>#{ @value.to_s.encode('utf-8').encode(:xml => :text) }</#{varn}>" end |