Class: HotCocoa::NSRangedProxyAttributedString
- Defined in:
- lib/hotcocoa/attributed_string_helpers.rb
Overview
Proxies the range of an attributed string.
Instance Attribute Summary collapse
-
#range ⇒ Range
readonly
Range in the string this proxy represents.
-
#string ⇒ NSMutableAttributedString
readonly
The string this proxy belongs to.
Instance Method Summary collapse
-
#attributes ⇒ HotCooca::NSRangedProxyAttributeHash
This method is useful because it allows an attributed string to return a hash of attributes that use Rubyish names instead of Objective-C ones.
-
#initialize(string, range) ⇒ NSRangedProxyAttributedString
constructor
A new instance of NSRangedProxyAttributedString.
Constructor Details
#initialize(string, range) ⇒ NSRangedProxyAttributedString
Returns a new instance of NSRangedProxyAttributedString.
119 120 121 122 |
# File 'lib/hotcocoa/attributed_string_helpers.rb', line 119 def initialize string, range @string = string @range = range end |
Instance Attribute Details
#range ⇒ Range (readonly)
Range in the string this proxy represents.
115 116 117 |
# File 'lib/hotcocoa/attributed_string_helpers.rb', line 115 def range @range end |
#string ⇒ NSMutableAttributedString (readonly)
The string this proxy belongs to.
109 110 111 |
# File 'lib/hotcocoa/attributed_string_helpers.rb', line 109 def string @string end |
Instance Method Details
#attributes ⇒ HotCooca::NSRangedProxyAttributeHash
This method is useful because it allows an attributed string to return a hash of attributes that use Rubyish names instead of Objective-C ones.
130 131 132 |
# File 'lib/hotcocoa/attributed_string_helpers.rb', line 130 def attributes HotCocoa::NSRangedProxyAttributeHash.new self end |