Class: FeldtRuby::RCommunicator::Rvalue
- Defined in:
- lib/feldtruby/statistics.rb
Overview
This represents a hash returned as JSON from R but mapped to a Ruby object so we can more easily use it as if it was an R object.
Instance Method Summary collapse
- #___ruby_name(name) ⇒ Object
-
#initialize(hash) ⇒ Rvalue
constructor
A new instance of Rvalue.
- #to_h ⇒ Object
Constructor Details
#initialize(hash) ⇒ Rvalue
Returns a new instance of Rvalue.
70 71 72 73 74 75 76 77 |
# File 'lib/feldtruby/statistics.rb', line 70 def initialize(hash) @___h = hash hash.to_a.each do |name, value| ruby_name = ___ruby_name(name) @___h[ruby_name] = @___h[name] if ruby_name != name self.define_singleton_method(ruby_name) {@___h[name]} end end |