Class: JSGF::Optional
- Inherits:
-
Object
- Object
- JSGF::Optional
- Includes:
- Enumerable
- Defined in:
- lib/jsgf/optional.rb
Instance Attribute Summary collapse
-
#elements ⇒ Object
readonly
Returns the value of attribute elements.
Enumerable collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ Optional
constructor
A new instance of Optional.
- #optional ⇒ Object
Constructor Details
#initialize(*args) ⇒ Optional
Returns a new instance of Optional.
7 8 9 |
# File 'lib/jsgf/optional.rb', line 7 def initialize(*args) @elements = args end |
Instance Attribute Details
#elements ⇒ Object (readonly)
Returns the value of attribute elements.
5 6 7 |
# File 'lib/jsgf/optional.rb', line 5 def elements @elements end |
Instance Method Details
#each(*args, &block) ⇒ Object
12 13 14 |
# File 'lib/jsgf/optional.rb', line 12 def each(*args, &block) elements.each(*args, &block) end |
#optional ⇒ Object
17 18 19 |
# File 'lib/jsgf/optional.rb', line 17 def optional true end |