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