Class: Begin::Tag
- Inherits:
-
Object
- Object
- Begin::Tag
- Defined in:
- lib/begin/config.rb
Overview
Represents an expected mustache tag, as defined in the template config. Every type of tag has a key name (as inserted into the mustache context), and a human-readable label (as presented to the user).
Instance Attribute Summary collapse
-
#array ⇒ Object
readonly
Returns the value of attribute array.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(key, label, array) ⇒ Tag
constructor
A new instance of Tag.
Constructor Details
#initialize(key, label, array) ⇒ Tag
Returns a new instance of Tag.
40 41 42 43 44 |
# File 'lib/begin/config.rb', line 40 def initialize(key, label, array) @key = key @label = label @array = array end |
Instance Attribute Details
#array ⇒ Object (readonly)
Returns the value of attribute array.
38 39 40 |
# File 'lib/begin/config.rb', line 38 def array @array end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
36 37 38 |
# File 'lib/begin/config.rb', line 36 def key @key end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
37 38 39 |
# File 'lib/begin/config.rb', line 37 def label @label end |
Class Method Details
.from_config(key, value) ⇒ Object
46 47 48 49 50 |
# File 'lib/begin/config.rb', line 46 def self.from_config(key, value) return HashTag.from_config(key, value) if value.include? 'tags' ValueTag.from_config(key, value) end |