Class: Bread::IvarsCommand
- Inherits:
-
Object
- Object
- Bread::IvarsCommand
- Defined in:
- lib/bread/commands/ivars_command.rb
Instance Attribute Summary collapse
-
#ivars ⇒ Object
readonly
Returns the value of attribute ivars.
Instance Method Summary collapse
-
#initialize(target) ⇒ IvarsCommand
constructor
A new instance of IvarsCommand.
Constructor Details
#initialize(target) ⇒ IvarsCommand
Returns a new instance of IvarsCommand.
6 7 8 9 10 11 12 13 |
# File 'lib/bread/commands/ivars_command.rb', line 6 def initialize(target) @ivars = {} ivars_keys = target.instance_variables.select { |key| not key.to_s.starts_with?('@_') } ivars_keys.each do |key| @ivars[key] = target.instance_variable_get(key) end end |
Instance Attribute Details
#ivars ⇒ Object (readonly)
Returns the value of attribute ivars.
4 5 6 |
# File 'lib/bread/commands/ivars_command.rb', line 4 def ivars @ivars end |