Class: Accio::Snippet

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#codeObject

Returns the value of attribute code.



9
10
11
# File 'lib/accio/snippet.rb', line 9

def code
  @code
end

#commentObject

Returns the value of attribute comment.



9
10
11
# File 'lib/accio/snippet.rb', line 9

def comment
  @comment
end

#titleObject

Returns the value of attribute title.



9
10
11
# File 'lib/accio/snippet.rb', line 9

def title
  @title
end