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.



21
22
23
# File 'lib/dreader.rb', line 21

def initialize
  @attributes = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



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

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

Instance Method Details

#to_hashObject



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

def to_hash
  @attributes
end