Class: Riddle::Configuration::Source
- Defined in:
- lib/riddle/configuration/source.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
Returns the value of attribute name.
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Methods inherited from Section
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
6 7 8 |
# File 'lib/riddle/configuration/source.rb', line 6 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
6 7 8 |
# File 'lib/riddle/configuration/source.rb', line 6 def parent @parent end |
#type ⇒ Object
Returns the value of attribute type.
6 7 8 |
# File 'lib/riddle/configuration/source.rb', line 6 def type @type end |
Instance Method Details
#render ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/riddle/configuration/source.rb', line 8 def render raise ConfigurationError unless valid? inherited_name = "#{name}" inherited_name += " : #{parent}" if parent ( ["source #{inherited_name}", "{"] + settings_body + ["}", ""] ).join("\n") end |
#valid? ⇒ Boolean
20 21 22 |
# File 'lib/riddle/configuration/source.rb', line 20 def valid? !( @name.nil? || @type.nil? ) end |