Class: Vindetta::Decoder::Result

Inherits:
Object
  • Object
show all
Extended by:
DSL
Defined in:
lib/vindetta/decoder/result.rb

Instance Method Summary collapse

Methods included from DSL

decoded_attributes, extended, has_value

Constructor Details

#initialize(variables) ⇒ Result

Returns a new instance of Result.



23
24
25
# File 'lib/vindetta/decoder/result.rb', line 23

def initialize(variables)
  @variables = variables
end

Instance Method Details

#inspectObject



27
28
29
# File 'lib/vindetta/decoder/result.rb', line 27

def inspect
  "#<Vindetta::Decoder::Response:#{"0x00%x" % (object_id << 1)}>"
end

#to_jsonObject



31
32
33
34
35
# File 'lib/vindetta/decoder/result.rb', line 31

def to_json
  self.class.decoded_attributes.map do |a|
    [a, send(a)]
  end.to_h
end