Class: Dreader::Options

Inherits:
Object
  • Object
show all
Defined in:
lib/dreader.rb

Overview

service class to implement the options DSL language

Instance Method Summary collapse

Constructor Details

#initializeOptions

Returns a new instance of Options.



26
27
28
# File 'lib/dreader.rb', line 26

def initialize
  @attributes = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



30
31
32
# File 'lib/dreader.rb', line 30

def method_missing(name, *args, &block)
  @attributes[name] = args[0]
end

Instance Method Details

#to_hashObject



34
35
36
# File 'lib/dreader.rb', line 34

def to_hash
  @attributes
end