Class: Markdoc::Sequence::Role
- Inherits:
-
Object
- Object
- Markdoc::Sequence::Role
- Defined in:
- lib/markdoc/sequence.rb
Instance Attribute Summary collapse
-
#active ⇒ Object
Returns the value of attribute active.
-
#id ⇒ Object
Returns the value of attribute id.
-
#label ⇒ Object
Returns the value of attribute label.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
- #activate ⇒ Object
- #deactivate ⇒ Object
-
#initialize(type, id, label) ⇒ Role
constructor
A new instance of Role.
Constructor Details
#initialize(type, id, label) ⇒ Role
Returns a new instance of Role.
30 31 32 33 |
# File 'lib/markdoc/sequence.rb', line 30 def initialize(type, id, label) self.type, self.id, self.label = type, id, label self.active = false end |
Instance Attribute Details
#active ⇒ Object
Returns the value of attribute active.
29 30 31 |
# File 'lib/markdoc/sequence.rb', line 29 def active @active end |
#id ⇒ Object
Returns the value of attribute id.
29 30 31 |
# File 'lib/markdoc/sequence.rb', line 29 def id @id end |
#label ⇒ Object
Returns the value of attribute label.
29 30 31 |
# File 'lib/markdoc/sequence.rb', line 29 def label @label end |
#type ⇒ Object
Returns the value of attribute type.
29 30 31 |
# File 'lib/markdoc/sequence.rb', line 29 def type @type end |
Instance Method Details
#activate ⇒ Object
34 35 36 37 38 |
# File 'lib/markdoc/sequence.rb', line 34 def activate return if active self.active = true "active(#{id});" end |
#deactivate ⇒ Object
39 40 41 42 43 |
# File 'lib/markdoc/sequence.rb', line 39 def deactivate return unless active self.active = false "inactive(#{id});" end |