Class: Bread::IvarsCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/bread/commands/ivars_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#ivarsObject (readonly)

Returns the value of attribute ivars.



4
5
6
# File 'lib/bread/commands/ivars_command.rb', line 4

def ivars
  @ivars
end