Class: Ruport::Controller::Options
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Ruport::Controller::Options
- Defined in:
- lib/ruport/controller.rb
Overview
Structure for holding controller options.
Simplified version of HashWithIndifferentAccess
Direct Known Subclasses
Instance Method Summary collapse
-
#[](key) ⇒ Object
Indifferent lookup of an attribute, e.g.
-
#[]=(key, value) ⇒ Object
Sets an attribute, with indifferent access.
-
#to_hash ⇒ Object
Returns a Hash object.
Instance Method Details
#[](key) ⇒ Object
Indifferent lookup of an attribute, e.g.
[:foo] == ["foo"]
41 42 43 |
# File 'lib/ruport/controller.rb', line 41 def [](key) send(key) end |
#[]=(key, value) ⇒ Object
Sets an attribute, with indifferent access.
[:foo] = "bar"
[:foo] == ["foo"] #=> true
["foo"] == .foo #=> true
.foo #=> "bar"
52 53 54 |
# File 'lib/ruport/controller.rb', line 52 def []=(key,value) send("#{key}=",value) end |
#to_hash ⇒ Object
Returns a Hash object. Use this if you need methods other than []
35 36 37 |
# File 'lib/ruport/controller.rb', line 35 def to_hash @table end |