Class: Rust::Call

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

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

Returns a new instance of Call.



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

def initialize(value)
    @value = value
end

Class Method Details

.can_pull?(type, klass) ⇒ Boolean

Returns:

  • (Boolean)


51
52
53
# File 'lib/rust/core/types/language.rb', line 51

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

.pull_variable(variable, type, klass) ⇒ Object



55
56
57
# File 'lib/rust/core/types/language.rb', line 55

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

Instance Method Details

#inspectObject



72
73
74
# File 'lib/rust/core/types/language.rb', line 72

def inspect
    @value
end

#load_in_r_as(variable_name) ⇒ Object



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

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

#valueObject



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

def value
    @value
end