Class: Briskly::Element
- Inherits:
-
Object
- Object
- Briskly::Element
- Defined in:
- lib/briskly/element.rb
Instance Attribute Summary collapse
-
#alternatives ⇒ Object
readonly
Returns the value of attribute alternatives.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#keyword(internal = nil) ⇒ Object
readonly
Returns the value of attribute keyword.
Instance Method Summary collapse
-
#initialize(keyword, data = nil, alternatives = []) ⇒ Element
constructor
A new instance of Element.
Constructor Details
#initialize(keyword, data = nil, alternatives = []) ⇒ Element
Returns a new instance of Element.
10 11 12 13 14 15 16 |
# File 'lib/briskly/element.rb', line 10 def initialize(keyword, data = nil, alternatives = []) raise ArgumentError unless keyword @keyword = Briskly::Keyword.new(keyword) @data = data @alternatives = alternatives.map { |alternative| Briskly::Keyword.new(alternative) } end |
Instance Attribute Details
#alternatives ⇒ Object (readonly)
Returns the value of attribute alternatives.
8 9 10 |
# File 'lib/briskly/element.rb', line 8 def alternatives @alternatives end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
6 7 8 |
# File 'lib/briskly/element.rb', line 6 def data @data end |
#keyword(internal = nil) ⇒ Object (readonly)
Returns the value of attribute keyword.
7 8 9 |
# File 'lib/briskly/element.rb', line 7 def keyword @keyword end |