Class: Tagtical::TagList::TagValue

Inherits:
String
  • Object
show all
Defined in:
lib/tagtical/tag_list.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value = "", relevance = nil) ⇒ TagValue

Returns a new instance of TagValue.



10
11
12
13
# File 'lib/tagtical/tag_list.rb', line 10

def initialize(value="", relevance=nil)
  @relevance = relevance.to_f if relevance
  super(value)
end

Instance Attribute Details

#relevanceObject

Returns the value of attribute relevance.



5
6
7
# File 'lib/tagtical/tag_list.rb', line 5

def relevance
  @relevance
end

Class Method Details

.parse(input) ⇒ Object



15
16
17
# File 'lib/tagtical/tag_list.rb', line 15

def self.parse(input)
  new(*input.to_s.split(relevance_delimiter, 2).each(&:strip!))
end