Class: DiffResource::Settings
- Inherits:
-
Object
- Object
- DiffResource::Settings
- Defined in:
- lib/diff_resource/settings.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
- #comparison ⇒ Object
-
#initialize(str) ⇒ Settings
constructor
A new instance of Settings.
- #output ⇒ Object
- #types ⇒ Object
Constructor Details
#initialize(str) ⇒ Settings
Returns a new instance of Settings.
5 6 7 8 9 |
# File 'lib/diff_resource/settings.rb', line 5 def initialize str @options = YAML.load(str) @options = {} unless @options.class == Hash # @options is Hash object @options["types"] = {} unless @options["types"].class == Hash # @options["types"] is Hash Object end |
Instance Method Details
#[](key) ⇒ Object
23 24 25 |
# File 'lib/diff_resource/settings.rb', line 23 def [] key return @options[key] end |
#comparison ⇒ Object
15 16 17 |
# File 'lib/diff_resource/settings.rb', line 15 def comparison return self["comparison"] end |
#output ⇒ Object
19 20 21 |
# File 'lib/diff_resource/settings.rb', line 19 def output return self["output"] end |
#types ⇒ Object
11 12 13 |
# File 'lib/diff_resource/settings.rb', line 11 def types return self["types"] end |