Class: Seasar::Container::PropertyDef
- Defined in:
- lib/seasar/container/property-def.rb
Instance Attribute Summary collapse
-
#property_name ⇒ Object
Returns the value of attribute property_name.
Attributes inherited from ArgDef
#child_component_def, #container, #expression, #value
Instance Method Summary collapse
-
#initialize(property_name, value = nil) ⇒ PropertyDef
constructor
-
args 1.
-
Constructor Details
#initialize(property_name, value = nil) ⇒ PropertyDef
-
args
-
Symbol|String property_name
-
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_name ⇒ Object
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 |