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.
263 264 265 266 |
# File 'lib/webri.rb', line 263 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.
261 262 263 |
# File 'lib/webri.rb', line 261 def full_name @full_name end |
#paths ⇒ Object
Returns the value of attribute paths.
261 262 263 |
# File 'lib/webri.rb', line 261 def paths @paths end |
Class Method Details
.choices(entries) ⇒ Object
Return hash of choice strings for entries.
269 270 271 272 273 274 275 276 277 278 |
# File 'lib/webri.rb', line 269 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.
285 286 287 |
# File 'lib/webri.rb', line 285 def self.full_name_for_choice(choice) choice.split(' ').first.sub(/:$/, '') end |
.uri(path) ⇒ Object
280 281 282 |
# File 'lib/webri.rb', line 280 def self.uri(path) URI.parse(path) end |