class Riml::RimlClassCommandNode

riml_import g:ClassName

Public Class Methods

new(*args) click to toggle source
Calls superclass method Riml::CallNode::new
# File lib/riml/nodes.rb, line 404
def initialize(*args)
  super
  string_node_arguments.each do |arg|
    class_name = arg.value
    # if '*' isn't a char in `class_name`, raise error
    if class_name.index('*').nil?
      msg = "* must be a character in class name '#{class_name}' if riml_import " \
      "is given a string. Try 'riml_import #{class_name}' instead."
      error = UserArgumentError.new(msg, self)
      raise error
    end
  end
end

Public Instance Methods

class_names_without_modifiers() click to toggle source
# File lib/riml/nodes.rb, line 418
def class_names_without_modifiers
  arguments.map do |full_name|
    full_name = full_name.value if full_name.respond_to?(:value)
    full_name.sub(/\A\w:/, '')
  end
end
string_node_arguments() click to toggle source
# File lib/riml/nodes.rb, line 425
def string_node_arguments
  arguments.select { |arg| StringNode === arg }
end