Class: WebRI::Entry
- Inherits:
-
Object
- Object
- WebRI::Entry
- Defined in:
- lib/webri.rb
Direct Known Subclasses
ClassEntry, FileEntry, InstanceMethodEntry, SingletonMethodEntry
Instance Attribute Summary collapse
-
#full_name ⇒ Object
Returns the value of attribute full_name.
-
#paths ⇒ Object
Returns the value of attribute paths.
Class Method Summary collapse
-
.choices(entries) ⇒ Object
Return hash of choice strings for entries.
-
.full_name_for_choice(choice) ⇒ Object
Return the full name from a choice string.
- .uri(path) ⇒ Object
Instance Method Summary collapse
-
#initialize(full_name) ⇒ Entry
constructor
A new instance of Entry.
Constructor Details
#initialize(full_name) ⇒ Entry
Returns a new instance of Entry.
209 210 211 212 |
# File 'lib/webri.rb', line 209 def initialize(full_name) self.full_name = full_name self.paths = [] end |
Instance Attribute Details
#full_name ⇒ Object
Returns the value of attribute full_name.
207 208 209 |
# File 'lib/webri.rb', line 207 def full_name @full_name end |
#paths ⇒ Object
Returns the value of attribute paths.
207 208 209 |
# File 'lib/webri.rb', line 207 def paths @paths end |
Class Method Details
.choices(entries) ⇒ Object
Return hash of choice strings for entries.
215 216 217 218 219 220 221 222 223 224 |
# File 'lib/webri.rb', line 215 def self.choices(entries) choices = {} entries.each_pair do |name, entry| entry.paths.each do |path| choice = self.choice(name, path) choices[choice] = path end end Hash[choices.sort] end |
.full_name_for_choice(choice) ⇒ Object
Return the full name from a choice string.
231 232 233 |
# File 'lib/webri.rb', line 231 def self.full_name_for_choice(choice) choice.split(' ').first.sub(/:$/, '') end |
.uri(path) ⇒ Object
226 227 228 |
# File 'lib/webri.rb', line 226 def self.uri(path) URI.parse(path) end |