Class: Flipper::Export
- Inherits:
-
Object
- Object
- Flipper::Export
- Defined in:
- lib/flipper/export.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#contents ⇒ Object
readonly
Returns the value of attribute contents.
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #adapter ⇒ Object
- #eql?(other) ⇒ Boolean (also: #==)
- #features ⇒ Object
-
#initialize(contents:, format: :json, version: 1) ⇒ Export
constructor
A new instance of Export.
Constructor Details
#initialize(contents:, format: :json, version: 1) ⇒ Export
Returns a new instance of Export.
5 6 7 8 9 |
# File 'lib/flipper/export.rb', line 5 def initialize(contents:, format: :json, version: 1) @contents = contents @format = format @version = version end |
Instance Attribute Details
#contents ⇒ Object (readonly)
Returns the value of attribute contents.
3 4 5 |
# File 'lib/flipper/export.rb', line 3 def contents @contents end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
3 4 5 |
# File 'lib/flipper/export.rb', line 3 def format @format end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
3 4 5 |
# File 'lib/flipper/export.rb', line 3 def version @version end |
Instance Method Details
#adapter ⇒ Object
15 16 17 |
# File 'lib/flipper/export.rb', line 15 def adapter @adapter ||= Flipper::Adapters::Memory.new(features) end |
#eql?(other) ⇒ Boolean Also known as: ==
19 20 21 |
# File 'lib/flipper/export.rb', line 19 def eql?(other) self.class.eql?(other.class) && @contents == other.contents && @format == other.format && @version == other.version end |
#features ⇒ Object
11 12 13 |
# File 'lib/flipper/export.rb', line 11 def features raise NotImplementedError end |