class FluentQuery::Data

Represents data hash.

In fact, it’s common Hash class extended by method which allow access its fields by “object way”.

Public Class Methods

new(data) click to toggle source

Constructor.

# File lib/fluent-query/data.rb, line 24
def initialize(data)
    @data = data
end

Public Instance Methods

[](key) click to toggle source

Maps array access to underlying data object.

# File lib/fluent-query/data.rb, line 40
def [](key)
    @data[key.to_sym]
end
method_missing(name, *args) click to toggle source

Maps missing calls to data elements.

# File lib/fluent-query/data.rb, line 32
def method_missing(name, *args)
    @data[name]
end
to_hash() click to toggle source

Converts data to hash.

# File lib/fluent-query/data.rb, line 48
def to_hash
    @data.to_hash.dup
end