Class: TypedAttributes::Parser::BaseType
- Inherits:
-
Object
- Object
- TypedAttributes::Parser::BaseType
show all
- Defined in:
- lib/typed_attributes/parser/base_type.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(model, attr, options = {}) ⇒ BaseType
7
8
9
10
11
|
# File 'lib/typed_attributes/parser/base_type.rb', line 7
def initialize(model, attr, options = {})
@model = model
@attribute = attr
@options = options || {}
end
|
Instance Attribute Details
#attribute ⇒ Object
Returns the value of attribute attribute.
5
6
7
|
# File 'lib/typed_attributes/parser/base_type.rb', line 5
def attribute
@attribute
end
|
#model ⇒ Object
Returns the value of attribute model.
5
6
7
|
# File 'lib/typed_attributes/parser/base_type.rb', line 5
def model
@model
end
|
#options ⇒ Object
Returns the value of attribute options.
5
6
7
|
# File 'lib/typed_attributes/parser/base_type.rb', line 5
def options
@options
end
|
Instance Method Details
#parse(value) ⇒ Object
13
14
15
|
# File 'lib/typed_attributes/parser/base_type.rb', line 13
def parse(value)
raise NotImplementedError.new
end
|
#readers ⇒ Object
21
22
23
|
# File 'lib/typed_attributes/parser/base_type.rb', line 21
def readers
[attribute]
end
|
#storage_var ⇒ Object
17
18
19
|
# File 'lib/typed_attributes/parser/base_type.rb', line 17
def storage_var
:"@#{attribute}"
end
|
#writers ⇒ Object
25
26
27
|
# File 'lib/typed_attributes/parser/base_type.rb', line 25
def writers
[:"#{attribute}="]
end
|