Class: Tagtical::TagList::TagValue
- Inherits:
-
String
- Object
- String
- Tagtical::TagList::TagValue
- Defined in:
- lib/tagtical/tag_list.rb
Instance Attribute Summary collapse
-
#relevance ⇒ Object
Returns the value of attribute relevance.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(value = "", relevance = nil) ⇒ TagValue
constructor
A new instance of TagValue.
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
#relevance ⇒ Object
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 |