Class: Seasar::Container::PropertyDef

Inherits:
ArgDef
  • Object
show all
Defined in:
lib/seasar/container/property-def.rb

Instance Attribute Summary collapse

Attributes inherited from ArgDef

#child_component_def, #container, #expression, #value

Instance Method Summary collapse

Constructor Details

#initialize(property_name, value = nil) ⇒ PropertyDef

  • args

    1. Symbol|String property_name

    2. Object value



26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/seasar/container/property-def.rb', line 26

def initialize(property_name, value = nil)
  super(value)
  if property_name.is_a?(Symbol)
    @property_name = property_name
  elsif property_name.is_a?(String)
    if property_name[0] == "@"
      @property_name = property_name.to_sym
    else
      @property_name = "@#{property_name}".to_sym
    end
  else
    raise ArgumentError.new("property name must be String or Symbol")
  end
end

Instance Attribute Details

#property_nameObject

Returns the value of attribute property_name.



40
41
42
# File 'lib/seasar/container/property-def.rb', line 40

def property_name
  @property_name
end