class IMS::LTI::Models::Parameter

Public Class Methods

process_params(parameters, lookup_hash) click to toggle source
# File lib/ims/lti/models/parameter.rb, line 10
def self.process_params(parameters, lookup_hash)
  [*parameters].inject({}) do |hash, param|
    hash[param.name] = param.fixed? ? param.fixed : expand_variable(lookup_hash[param.variable]) || '$' + param.variable
    hash
  end
end

Private Class Methods

expand_variable(value) click to toggle source
# File lib/ims/lti/models/parameter.rb, line 23
def self.expand_variable(value)
  value.respond_to?(:call) ? value.call : value
end

Public Instance Methods

==(obj) click to toggle source
# File lib/ims/lti/models/parameter.rb, line 17
def ==(obj)
  self.fixed? == obj.fixed? && self.name == obj.name && self.fixed == obj.fixed
end
fixed?() click to toggle source
# File lib/ims/lti/models/parameter.rb, line 6
def fixed?
  !fixed.nil? && fixed.to_s.strip != ''
end