Class: Wolfram::HashPresenter

Inherits:
Object
  • Object
show all
Defined in:
lib/wolfram/hash_presenter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(result) ⇒ HashPresenter

Returns a new instance of HashPresenter.



5
6
7
# File 'lib/wolfram/hash_presenter.rb', line 5

def initialize(result)
  @result = result
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args, &block) ⇒ Object (private)



30
31
32
33
34
35
36
# File 'lib/wolfram/hash_presenter.rb', line 30

def method_missing(method, *args, &block)
  if result.respond_to? method
    result.send(method, *args, &block)
  else
    super
  end
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/wolfram/hash_presenter.rb', line 3

def result
  @result
end

Instance Method Details

#to_hashObject



9
10
11
12
13
14
# File 'lib/wolfram/hash_presenter.rb', line 9

def to_hash
  {
    :pods => pods_to_hash,
    :assumptions => assumptions_to_hash
  }
end