Class: Rust::Call

Inherits:
RustDatatype show all
Defined in:
lib/rust/core/types/language.rb

Overview

Mirror of the call type in R.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from RustDatatype

pull_priority, #r_hash, #r_mirror, #r_mirror_to

Constructor Details

#initialize(value) ⇒ Call

Creates a new call with the given value (String).



77
78
79
# File 'lib/rust/core/types/language.rb', line 77

def initialize(value)
    @value = value
end

Class Method Details

.can_pull?(type, klass) ⇒ Boolean

Returns:

  • (Boolean)


61
62
63
# File 'lib/rust/core/types/language.rb', line 61

def self.can_pull?(type, klass)
    return klass == "call"
end

.pull_variable(variable, type, klass) ⇒ Object



65
66
67
# File 'lib/rust/core/types/language.rb', line 65

def self.pull_variable(variable, type, klass)
    return Call.new(Rust["deparse(#{variable})"])
end

Instance Method Details

#inspectObject



85
86
87
# File 'lib/rust/core/types/language.rb', line 85

def inspect
    @value
end

#load_in_r_as(variable_name) ⇒ Object



69
70
71
72
# File 'lib/rust/core/types/language.rb', line 69

def load_in_r_as(variable_name)
    Rust["call.str"] = @value
    Rust._eval("#{variable_name} <- str2lang(call.str)")
end

#valueObject



81
82
83
# File 'lib/rust/core/types/language.rb', line 81

def value
    @value
end