Class: AttributedString::Attribute
- Inherits:
-
Object
- Object
- AttributedString::Attribute
- Defined in:
- lib/attributed_string/attribute.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#range ⇒ Object
readonly
Returns the value of attribute range.
Instance Method Summary collapse
-
#initialize(range, data) ⇒ Attribute
constructor
A new instance of Attribute.
- #move(offset) ⇒ Object
Constructor Details
#initialize(range, data) ⇒ Attribute
Returns a new instance of Attribute.
6 7 8 9 |
# File 'lib/attributed_string/attribute.rb', line 6 def initialize(range, data) @range = range @data = data end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/attributed_string/attribute.rb', line 4 def data @data end |
#range ⇒ Object (readonly)
Returns the value of attribute range.
4 5 6 |
# File 'lib/attributed_string/attribute.rb', line 4 def range @range end |
Instance Method Details
#move(offset) ⇒ Object
11 12 13 |
# File 'lib/attributed_string/attribute.rb', line 11 def move(offset) @range = Range.new(@range.begin + offset, @range.end + offset, @range.exclude_end?) end |