Class: SentenceBuilder::BaseNode
- Inherits:
-
Object
- Object
- SentenceBuilder::BaseNode
- Defined in:
- lib/sentence_builder/base_node.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#default ⇒ Object
readonly
Returns the value of attribute default.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(name, options = {}) ⇒ BaseNode
constructor
A new instance of BaseNode.
- #prefix ⇒ Object
- #prefix=(new_prefix) ⇒ Object
- #suffix ⇒ Object
- #suffix=(new_suffix) ⇒ Object
Constructor Details
#initialize(name, options = {}) ⇒ BaseNode
Returns a new instance of BaseNode.
5 6 7 8 9 |
# File 'lib/sentence_builder/base_node.rb', line 5 def initialize(name, = {}) @name = name.to_sym = @default = [:default] || nil end |
Instance Attribute Details
#default ⇒ Object (readonly)
Returns the value of attribute default.
3 4 5 |
# File 'lib/sentence_builder/base_node.rb', line 3 def default @default end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/sentence_builder/base_node.rb', line 3 def name @name end |
Instance Method Details
#prefix ⇒ Object
11 12 13 |
# File 'lib/sentence_builder/base_node.rb', line 11 def prefix [:prefix] || '' end |
#prefix=(new_prefix) ⇒ Object
15 16 17 |
# File 'lib/sentence_builder/base_node.rb', line 15 def prefix=(new_prefix) [:prefix] = new_prefix || '' end |
#suffix ⇒ Object
19 20 21 |
# File 'lib/sentence_builder/base_node.rb', line 19 def suffix [:suffix] || '' end |
#suffix=(new_suffix) ⇒ Object
23 24 25 |
# File 'lib/sentence_builder/base_node.rb', line 23 def suffix=(new_suffix) [:suffix] = new_suffix || '' end |