Class: Serializer::Value
- Inherits:
-
Object
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.
3
4
5
6
|
# File 'lib/serializer/value.rb', line 3
def initialize(attribute, scope = nil)
@attribute = attribute
@scope = scope
end
|
Instance Method Details
8
9
10
|
# File 'lib/serializer/value.rb', line 8
def
@attribute.from || @attribute.key
end
|
#precondition? ⇒ Boolean
12
13
14
|
# File 'lib/serializer/value.rb', line 12
def precondition?
raise NotImplementedError, 'needs a method called precondition?'
end
|
#value ⇒ Object
16
17
18
|
# File 'lib/serializer/value.rb', line 16
def value
raise NotImplementedError, 'needs a method called value'
end
|