Class: Shortcut
- Inherits:
-
Object
- Object
- Shortcut
- Defined in:
- lib/shortcut.rb
Constant Summary collapse
- @@all =
[]
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#key_seq ⇒ Object
Returns the value of attribute key_seq.
-
#name ⇒ Object
Returns the value of attribute name.
-
#operating_system ⇒ Object
Returns the value of attribute operating_system.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, key_seq, description, operating_system) ⇒ Shortcut
constructor
A new instance of Shortcut.
- #save ⇒ Object
Constructor Details
#initialize(name, key_seq, description, operating_system) ⇒ Shortcut
Returns a new instance of Shortcut.
6 7 8 9 10 11 |
# File 'lib/shortcut.rb', line 6 def initialize(name, key_seq, description, ) @name = name @key_seq = key_seq @description = description @operating_system = end |
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/shortcut.rb', line 4 def description @description end |
#key_seq ⇒ Object
Returns the value of attribute key_seq.
4 5 6 |
# File 'lib/shortcut.rb', line 4 def key_seq @key_seq end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/shortcut.rb', line 4 def name @name end |
#operating_system ⇒ Object
Returns the value of attribute operating_system.
4 5 6 |
# File 'lib/shortcut.rb', line 4 def @operating_system end |
Class Method Details
.all ⇒ Object
34 35 36 |
# File 'lib/shortcut.rb', line 34 def self.all @@all end |
.create_from_attribute_array(attribute_array) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/shortcut.rb', line 21 def self.create_from_attribute_array(attribute_array) = OperatingSystem.(attribute_array[3]) name = attribute_array[0] key_seq = attribute_array[1] description = attribute_array[2] shortcut = Shortcut.new(name, key_seq, description, ) shortcut.save .add_shortcut(shortcut) end |
Instance Method Details
#save ⇒ Object
17 18 19 |
# File 'lib/shortcut.rb', line 17 def save @@all << self end |