Class: Command::SubjectImage

Inherits:
Object
  • Object
show all
Defined in:
lib/command-set/subject.rb

Overview

This is the object type that’s actually passed to a command. It’s populated using the subject_methods that the command declared, using values from the application Subject.

Instance Method Summary collapse

Instance Method Details

#add_field(name, value) ⇒ Object

You shouldn’t really need to ever call this - it’s used by the interpreter to set up the image before it’s passed to the command



79
80
81
82
83
84
85
86
87
# File 'lib/command-set/subject.rb', line 79

def add_field(name, value)
    meta = class << self; self; end

  meta.instance_eval do
    define_method("#{name}") do
      return value
    end
  end
end