Class: HecksDomain::Parser::ValueField
- Inherits:
-
Object
- Object
- HecksDomain::Parser::ValueField
show all
- Defined in:
- lib/hecks/domain/parser/value_field.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ValueField.
8
9
10
|
# File 'lib/hecks/domain/parser/value_field.rb', line 8
def initialize(name)
@name = name
end
|
Instance Attribute Details
#name ⇒ Object
Returns the value of attribute name.
4
5
6
|
# File 'lib/hecks/domain/parser/value_field.rb', line 4
def name
@name
end
|
#optional=(value) ⇒ Object
Sets the attribute optional
5
6
7
|
# File 'lib/hecks/domain/parser/value_field.rb', line 5
def optional=(value)
@optional = value
end
|
#read_only=(value) ⇒ Object
Sets the attribute read_only
6
7
8
|
# File 'lib/hecks/domain/parser/value_field.rb', line 6
def read_only=(value)
@read_only = value
end
|
Instance Method Details
#as(name) ⇒ Object
42
43
44
45
|
# File 'lib/hecks/domain/parser/value_field.rb', line 42
def as(name)
@as = name
self
end
|
#attribute_name ⇒ Object
20
21
22
23
24
|
# File 'lib/hecks/domain/parser/value_field.rb', line 20
def attribute_name
return name.to_s + ':' unless optional?
name.to_s + ': nil'
end
|
#initial_state ⇒ Object
16
17
18
|
# File 'lib/hecks/domain/parser/value_field.rb', line 16
def initial_state
name
end
|
#module_name ⇒ Object
34
35
36
|
# File 'lib/hecks/domain/parser/value_field.rb', line 34
def module_name
@as
end
|
#optional? ⇒ Boolean
12
13
14
|
# File 'lib/hecks/domain/parser/value_field.rb', line 12
def optional?
@optional
end
|
#private_accessor ⇒ Object
30
31
32
|
# File 'lib/hecks/domain/parser/value_field.rb', line 30
def private_accessor
":#{name}"
end
|
#public_accessor ⇒ Object
26
27
28
|
# File 'lib/hecks/domain/parser/value_field.rb', line 26
def public_accessor
":#{name}"
end
|
#read_only? ⇒ Boolean
38
39
40
|
# File 'lib/hecks/domain/parser/value_field.rb', line 38
def read_only?
@read_only
end
|