Class: Command::SubjectImage
- Inherits:
-
Object
- Object
- Command::SubjectImage
- 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
-
#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.
- #get_image(fields) ⇒ Object
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
194 195 196 197 198 199 200 |
# File 'lib/command-set/subject.rb', line 194 def add_field(name, value) (class << self; self; end).instance_eval do define_method("#{name}") do return value end end end |
#get_image(fields) ⇒ Object
202 203 204 205 |
# File 'lib/command-set/subject.rb', line 202 def get_image(fields) #TODO: fail if I don't respond to a field return self end |