Class: Seri::Serializer::Value
- Inherits:
-
Object
- Object
- Seri::Serializer::Value
show all
- Defined in:
- lib/serializer/value.rb
Instance Method Summary
collapse
Constructor Details
#initialize(attribute, scope = nil) ⇒ Value
Returns a new instance of Value.
4
5
6
7
|
# File 'lib/serializer/value.rb', line 4
def initialize(attribute, scope = nil)
@attribute = attribute
@scope = scope
end
|
Instance Method Details
9
10
11
|
# File 'lib/serializer/value.rb', line 9
def
@attribute.from || @attribute.key
end
|
#precondition? ⇒ Boolean
13
14
15
|
# File 'lib/serializer/value.rb', line 13
def precondition?
raise NotImplementedError, 'needs a method called precondition?'
end
|
#value ⇒ Object
17
18
19
|
# File 'lib/serializer/value.rb', line 17
def value
raise NotImplementedError, 'needs a method called value'
end
|