Class: Promethee::Data

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

Direct Known Subclasses

Localization, Master, MasterLocalized, MastersMultiple

Defined Under Namespace

Classes: Localization, Master, MasterLocalized, MastersMultiple

Instance Method Summary collapse

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

#dataObject



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

Returns:

  • (Boolean)


11
12
13
# File 'lib/promethee/data.rb', line 11

def include?(value)
  @data.include? value
end

#to_jsonObject



19
20
21
# File 'lib/promethee/data.rb', line 19

def to_json
  @data.to_json
end