Class: AliasLine
- Inherits:
-
Object
- Object
- AliasLine
- Defined in:
- lib/shell/alias_line.rb
Instance Attribute Summary collapse
-
#line ⇒ Object
Returns the value of attribute line.
Instance Method Summary collapse
- #alias_name ⇒ Object
- #command ⇒ Object
-
#initialize(line) ⇒ AliasLine
constructor
A new instance of AliasLine.
- #valid? ⇒ Boolean
Constructor Details
#initialize(line) ⇒ AliasLine
Returns a new instance of AliasLine.
4 5 6 |
# File 'lib/shell/alias_line.rb', line 4 def initialize(line) @line = line end |
Instance Attribute Details
#line ⇒ Object
Returns the value of attribute line.
2 3 4 |
# File 'lib/shell/alias_line.rb', line 2 def line @line end |
Instance Method Details
#alias_name ⇒ Object
8 9 10 |
# File 'lib/shell/alias_line.rb', line 8 def alias_name @line.split("=").first end |
#command ⇒ Object
16 17 18 19 |
# File 'lib/shell/alias_line.rb', line 16 def command c = @line.split("=")[1] c[1..(c.size-2)] if c end |
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/shell/alias_line.rb', line 12 def valid? @line.scan("=") != [] end |