Class: FruitToLime::Tag

Inherits:
Object
  • Object
show all
Defined in:
lib/fruit_to_lime/model/tag.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(val = nil) ⇒ Tag

Returns a new instance of Tag.



11
12
13
14
15
# File 'lib/fruit_to_lime/model/tag.rb', line 11

def initialize(val=nil)
    if val
        @value = val
    end
end

Instance Attribute Details

#valueObject

Returns the value of attribute value.



9
10
11
# File 'lib/fruit_to_lime/model/tag.rb', line 9

def value
  @value
end

Instance Method Details

#==(other) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/fruit_to_lime/model/tag.rb', line 27

def ==(other)
    if other.respond_to?(:value)
        return @value == other.value
    else
        return false
    end
end

#serialize_nameObject



5
6
7
# File 'lib/fruit_to_lime/model/tag.rb', line 5

def serialize_name
    "Tag"
end

#to_sObject



23
24
25
# File 'lib/fruit_to_lime/model/tag.rb', line 23

def to_s
    return "tag: '#{@value}'"
end