Class: Promethee::Data
- Inherits:
-
Object
- Object
- Promethee::Data
- Defined in:
- lib/promethee/data.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Localization, Master, MasterLocalized, MastersMultiple
Instance Method Summary collapse
- #[](value) ⇒ Object
- #data ⇒ Object
-
#include?(value) ⇒ Boolean
The class creates a facade in front of the real hash, therefore include?, [] and to_json are delegated.
-
#initialize(data) ⇒ Data
constructor
A new instance of Data.
- #to_json ⇒ Object
Constructor Details
#initialize(data) ⇒ Data
Returns a new instance of Data.
2 3 4 |
# File 'lib/promethee/data.rb', line 2 def initialize(data) @data = hashify data end |
Instance Method Details
#[](value) ⇒ Object
15 16 17 |
# File 'lib/promethee/data.rb', line 15 def [](value) @data[value] end |
#data ⇒ Object
6 7 8 |
# File 'lib/promethee/data.rb', line 6 def data @data end |
#include?(value) ⇒ Boolean
The class creates a facade in front of the real hash, therefore include?, [] and to_json are delegated
11 12 13 |
# File 'lib/promethee/data.rb', line 11 def include?(value) @data.include? value end |
#to_json ⇒ Object
19 20 21 |
# File 'lib/promethee/data.rb', line 19 def to_json @data.to_json end |