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.
7 8 9 10 11 |
# File 'lib/flipper/export.rb', line 7 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.
5 6 7 |
# File 'lib/flipper/export.rb', line 5 def contents @contents end |
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/flipper/export.rb', line 5 def format @format end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
5 6 7 |
# File 'lib/flipper/export.rb', line 5 def version @version end |
Instance Method Details
#adapter ⇒ Object
17 18 19 |
# File 'lib/flipper/export.rb', line 17 def adapter @adapter ||= Flipper::Adapters::Memory.new(features) end |
#eql?(other) ⇒ Boolean Also known as: ==
21 22 23 |
# File 'lib/flipper/export.rb', line 21 def eql?(other) self.class.eql?(other.class) && @contents == other.contents && @format == other.format && @version == other.version end |
#features ⇒ Object
13 14 15 |
# File 'lib/flipper/export.rb', line 13 def features raise NotImplementedError end |