Class: Html2rss::AttributePostProcessors::Substring
- Inherits:
-
Object
- Object
- Html2rss::AttributePostProcessors::Substring
- Defined in:
- lib/html2rss/attribute_post_processors/substring.rb
Instance Method Summary collapse
- #get ⇒ Object
-
#initialize(value, options, _item) ⇒ Substring
constructor
A new instance of Substring.
Constructor Details
#initialize(value, options, _item) ⇒ Substring
Returns a new instance of Substring.
4 5 6 7 |
# File 'lib/html2rss/attribute_post_processors/substring.rb', line 4 def initialize(value, , _item) @value = value = end |
Instance Method Details
#get ⇒ Object
9 10 11 12 |
# File 'lib/html2rss/attribute_post_processors/substring.rb', line 9 def get ending = .fetch('end', false) ? ['end'].to_i : @value.length @value[['start'].to_i..ending] end |