Class: Rocx::Properties::BaseProperty
- Inherits:
-
Object
- Object
- Rocx::Properties::BaseProperty
show all
- Defined in:
- lib/rocx/properties/base_property.rb
Class Attribute Summary collapse
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Class Attribute Details
.property_name ⇒ Object
Returns the value of attribute property_name.
7
8
9
|
# File 'lib/rocx/properties/base_property.rb', line 7
def property_name
@property_name
end
|
Instance Attribute Details
#value ⇒ Object
Returns the value of attribute value.
4
5
6
|
# File 'lib/rocx/properties/base_property.rb', line 4
def value
@value
end
|
Class Method Details
.name(*args) ⇒ Object
14
15
16
17
|
# File 'lib/rocx/properties/base_property.rb', line 14
def name(*args)
@property_name = args.first if args.any?
@name
end
|
.tag(*args) ⇒ Object
9
10
11
12
|
# File 'lib/rocx/properties/base_property.rb', line 9
def tag(*args)
@tag = args.first if args.any?
@tag
end
|
Instance Method Details
#default_name ⇒ Object
28
29
30
|
# File 'lib/rocx/properties/base_property.rb', line 28
def default_name
class_name.gsub(/(.)([A-Z])/, '\1_\2').downcase
end
|
#default_tag ⇒ Object
36
37
38
|
# File 'lib/rocx/properties/base_property.rb', line 36
def default_tag
(class_name[0, 1].downcase + class_name[1..-1]).to_sym
end
|
#name ⇒ Object
24
25
26
|
# File 'lib/rocx/properties/base_property.rb', line 24
def name
self.class.property_name || default_name
end
|
#render? ⇒ Boolean
20
21
22
|
# File 'lib/rocx/properties/base_property.rb', line 20
def render?
!value.nil?
end
|
#tag ⇒ Object
32
33
34
|
# File 'lib/rocx/properties/base_property.rb', line 32
def tag
self.class.tag || default_tag
end
|