Class: Accio::Snippet
- Inherits:
-
Object
- Object
- Accio::Snippet
- Defined in:
- lib/accio/snippet.rb
Overview
Public: Represents a snippet (e. g. Read Files, Establish SSH Connection etc.). A snippet consists of a title, a code part and optionally of a comment.
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(title, code = "", comment = "") ⇒ Snippet
constructor
Public: Constructor.
Constructor Details
#initialize(title, code = "", comment = "") ⇒ Snippet
Public: Constructor.
title - The title of the snippet. code - The associated code. comment - The associated comment.
16 17 18 19 20 |
# File 'lib/accio/snippet.rb', line 16 def initialize(title, code = "", comment = "") @title = title @code = Code.new(code) @comment = Comment.new(comment) end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
9 10 11 |
# File 'lib/accio/snippet.rb', line 9 def code @code end |
#comment ⇒ Object
Returns the value of attribute comment.
9 10 11 |
# File 'lib/accio/snippet.rb', line 9 def comment @comment end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/accio/snippet.rb', line 9 def title @title end |