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.
251 252 253 254 |
# File 'lib/webri.rb', line 251 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.
249 250 251 |
# File 'lib/webri.rb', line 249 def full_name @full_name end |
#paths ⇒ Object
Returns the value of attribute paths.
249 250 251 |
# File 'lib/webri.rb', line 249 def paths @paths end |
Class Method Details
.choices(entries) ⇒ Object
Return hash of choice strings for entries.
257 258 259 260 261 262 263 264 265 266 |
# File 'lib/webri.rb', line 257 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.
273 274 275 |
# File 'lib/webri.rb', line 273 def self.full_name_for_choice(choice) choice.split(' ').first.sub(/:$/, '') end |
.uri(path) ⇒ Object
268 269 270 |
# File 'lib/webri.rb', line 268 def self.uri(path) URI.parse(path) end |