Class: Buildozer::Dsl::Fragment

Inherits:
Object
  • Object
show all
Defined in:
lib/buildozer/dsl/fragment.rb

Direct Known Subclasses

Definition, Package

Instance Method Summary collapse

Instance Method Details

#name_to_key(name) ⇒ Object



10
11
12
13
14
15
# File 'lib/buildozer/dsl/fragment.rb', line 10

def name_to_key(name)
  name = name.to_s

  # Remove first char of instance name, i.e. the @ sign
  return name.slice(1, name.length).to_sym
end

#optionsObject



4
5
6
# File 'lib/buildozer/dsl/fragment.rb', line 4

def options()
  return Hash[instance_variables.map { |name| [name_to_key(name), instance_variable_get(name)] } ]
end