Class: Stamina::Gui::Examples::Example
- Inherits:
-
Object
- Object
- Stamina::Gui::Examples::Example
- Defined in:
- lib/stamina-gui/stamina/gui/examples.rb
Overview
class Category
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
Instance Method Summary collapse
-
#initialize(file) ⇒ Example
constructor
A new instance of Example.
- #label ⇒ Object
- #source ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(file) ⇒ Example
Returns a new instance of Example.
47 48 49 |
# File 'lib/stamina-gui/stamina/gui/examples.rb', line 47 def initialize(file) @file = file end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
45 46 47 |
# File 'lib/stamina-gui/stamina/gui/examples.rb', line 45 def file @file end |
Instance Method Details
#label ⇒ Object
55 56 57 58 |
# File 'lib/stamina-gui/stamina/gui/examples.rb', line 55 def label File.basename(file) =~ /^\d+-(.*)\.rb$/ $1.gsub(/-/, " ").capitalize end |
#source ⇒ Object
60 61 62 |
# File 'lib/stamina-gui/stamina/gui/examples.rb', line 60 def source File.read(file) end |
#url ⇒ Object
51 52 53 |
# File 'lib/stamina-gui/stamina/gui/examples.rb', line 51 def url File.basename(file, ".rb") end |