Class: CouchShell::VariableInfo
- Inherits:
-
Object
- Object
- CouchShell::VariableInfo
- Defined in:
- lib/couch-shell/plugin.rb
Instance Attribute Summary collapse
-
#doc_line ⇒ Object
readonly
Returns the value of attribute doc_line.
-
#doc_text ⇒ Object
readonly
Returns the value of attribute doc_text.
-
#lookup_message ⇒ Object
readonly
Returns the value of attribute lookup_message.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#plugin ⇒ Object
readonly
Returns the value of attribute plugin.
-
#prefix ⇒ Object
readonly
Returns the value of attribute prefix.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
Instance Method Summary collapse
-
#initialize(opts) ⇒ VariableInfo
constructor
A new instance of VariableInfo.
- #label ⇒ Object
Constructor Details
#initialize(opts) ⇒ VariableInfo
Returns a new instance of VariableInfo.
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/couch-shell/plugin.rb', line 21 def initialize(opts) @name = opts[:name] @prefix = opts[:prefix] raise "name or prefix required" unless @name || @prefix raise "only name OR prefix allowed" if @name && @prefix @tags = [@name || @prefix].concat(opts[:tags] || []) @doc_line = opts[:doc_line] or raise "doc_line required" @doc_text = opts[:doc_text] @lookup_message = opts[:lookup_message] or raise "lookup_message required" @plugin = opts[:plugin] or raise "plugin required" end |
Instance Attribute Details
#doc_line ⇒ Object (readonly)
Returns the value of attribute doc_line.
16 17 18 |
# File 'lib/couch-shell/plugin.rb', line 16 def doc_line @doc_line end |
#doc_text ⇒ Object (readonly)
Returns the value of attribute doc_text.
17 18 19 |
# File 'lib/couch-shell/plugin.rb', line 17 def doc_text @doc_text end |
#lookup_message ⇒ Object (readonly)
Returns the value of attribute lookup_message.
18 19 20 |
# File 'lib/couch-shell/plugin.rb', line 18 def @lookup_message end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
13 14 15 |
# File 'lib/couch-shell/plugin.rb', line 13 def name @name end |
#plugin ⇒ Object (readonly)
Returns the value of attribute plugin.
19 20 21 |
# File 'lib/couch-shell/plugin.rb', line 19 def plugin @plugin end |
#prefix ⇒ Object (readonly)
Returns the value of attribute prefix.
14 15 16 |
# File 'lib/couch-shell/plugin.rb', line 14 def prefix @prefix end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
15 16 17 |
# File 'lib/couch-shell/plugin.rb', line 15 def @tags end |
Instance Method Details
#label ⇒ Object
33 34 35 |
# File 'lib/couch-shell/plugin.rb', line 33 def label @name || "#@prefix*" end |