class Sigimera::Crisis

This class encapsulates the access to crisis JSON objects. Additional it simulates the access syntax of JSON objects. For future use this class can implemente different type of checks.

Public Class Methods

new(json_object) click to toggle source
# File lib/sigimera/data/crisis.rb, line 15
def initialize json_object
        @crisis = json_object
end

Public Instance Methods

[](key) click to toggle source

Simulates the same access as for JSON objects

# File lib/sigimera/data/crisis.rb, line 20
def [](key)
        @crisis[key.to_s] if @crisis and @crisis.class.eql?(Hash)
end
method_missing(method) click to toggle source

Provides for each json key an instance method

# File lib/sigimera/data/crisis.rb, line 25
def method_missing(method)
        @crisis[method.to_s] if @crisis and @crisis.class.eql?(Hash) and @crisis.key?(method.to_s)
end