Class: SerializationContext
- Inherits:
-
Object
- Object
- SerializationContext
- Defined in:
- lib/panko/serializer.rb
Instance Attribute Summary collapse
-
#context ⇒ Object
Returns the value of attribute context.
-
#scope ⇒ Object
Returns the value of attribute scope.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(context, scope) ⇒ SerializationContext
constructor
A new instance of SerializationContext.
Constructor Details
#initialize(context, scope) ⇒ SerializationContext
Returns a new instance of SerializationContext.
9 10 11 12 |
# File 'lib/panko/serializer.rb', line 9 def initialize(context, scope) @context = context @scope = scope end |
Instance Attribute Details
#context ⇒ Object
Returns the value of attribute context.
7 8 9 |
# File 'lib/panko/serializer.rb', line 7 def context @context end |
#scope ⇒ Object
Returns the value of attribute scope.
7 8 9 |
# File 'lib/panko/serializer.rb', line 7 def scope @scope end |
Class Method Details
.create(options) ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/panko/serializer.rb', line 14 def self.create() if .key?(:context) || .key?(:scope) SerializationContext.new([:context], [:scope]) else EmptySerializerContext.new end end |