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.
4 5 6 |
# File 'lib/riddle/configuration/source.rb', line 4 def name @name end |
#parent ⇒ Object
Returns the value of attribute parent.
4 5 6 |
# File 'lib/riddle/configuration/source.rb', line 4 def parent @parent end |
#type ⇒ Object
Returns the value of attribute type.
4 5 6 |
# File 'lib/riddle/configuration/source.rb', line 4 def type @type end |
Instance Method Details
#render ⇒ Object
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/riddle/configuration/source.rb', line 6 def render raise ConfigurationError unless valid? inherited_name = "#{name}" inherited_name << " : #{parent}" if parent ( ["source #{inherited_name}", "{"] + settings_body + ["}", ""] ).join("\n") end |
#valid? ⇒ Boolean
18 19 20 |
# File 'lib/riddle/configuration/source.rb', line 18 def valid? !( @name.nil? || @type.nil? ) end |