Class: IML::Text
- Inherits:
-
String
- Object
- String
- IML::Text
- Defined in:
- lib/iml/text.rb
Overview
Parsing and mangling of text metadata
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
Instance Method Summary collapse
-
#detect ⇒ <IML::Movie>, <IML::TVSeries>
Determine if IML::Text matches rules for a media type.
-
#initialize(string = nil, options = {}) ⇒ Text
constructor
A new instance of Text.
-
#to_title ⇒ Object
Convert IML::Text to desired title format.
Constructor Details
#initialize(string = nil, options = {}) ⇒ Text
Returns a new instance of Text.
7 8 9 10 |
# File 'lib/iml/text.rb', line 7 def initialize(string = nil, = {}) @options = super(string.to_s) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
5 6 7 |
# File 'lib/iml/text.rb', line 5 def @options end |
Instance Method Details
#detect ⇒ <IML::Movie>, <IML::TVSeries>
Determine if IML::Text matches rules for a media type
19 20 21 |
# File 'lib/iml/text.rb', line 19 def detect tv? || movie? || false end |
#to_title ⇒ Object
Convert IML::Text to desired title format
13 14 15 |
# File 'lib/iml/text.rb', line 13 def to_title tr('.', ' ').tr('_', ' ').titleize end |