Class: Fiona7::AttributeNameMangler

Inherits:
Object
  • Object
show all
Defined in:
lib/fiona7/attribute_name_mangler.rb

Instance Method Summary collapse

Constructor Details

#initialize(attribute, obj_class) ⇒ AttributeNameMangler

Returns a new instance of AttributeNameMangler.



5
6
7
8
# File 'lib/fiona7/attribute_name_mangler.rb', line 5

def initialize(attribute, obj_class)
  @attribute = attribute
  @obj_class = obj_class
end

Instance Method Details

#mangleObject



10
11
12
13
14
15
16
17
# File 'lib/fiona7/attribute_name_mangler.rb', line 10

def mangle
  if Fiona7.mode == :standalone
    mangled_obj_class = Fiona7::ObjClassNameMangler.new(@obj_class).mangle
    "s_#{mangled_obj_class}__#{@attribute}"
  else
    @attribute
  end
end