cephalopod 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (42) hide show
  1. checksums.yaml +7 -0
  2. data/.rspec +3 -0
  3. data/CHANGELOG.md +5 -0
  4. data/CODE_OF_CONDUCT.md +84 -0
  5. data/Gemfile +10 -0
  6. data/Gemfile.lock +102 -0
  7. data/LICENSE.txt +21 -0
  8. data/README.md +75 -0
  9. data/Rakefile +8 -0
  10. data/cephalopod.gemspec +43 -0
  11. data/lib/cephalopod/adaptor.rb +27 -0
  12. data/lib/cephalopod/models/base.rb +7 -0
  13. data/lib/cephalopod/models/charge.rb +12 -0
  14. data/lib/cephalopod/models/consumption.rb +11 -0
  15. data/lib/cephalopod/models/gsp.rb +10 -0
  16. data/lib/cephalopod/models/link.rb +15 -0
  17. data/lib/cephalopod/models/meter_point.rb +11 -0
  18. data/lib/cephalopod/models/product.rb +35 -0
  19. data/lib/cephalopod/models/product_summary.rb +35 -0
  20. data/lib/cephalopod/models/products/dual_register_charge.rb +26 -0
  21. data/lib/cephalopod/models/products/single_register_charge.rb +24 -0
  22. data/lib/cephalopod/repos/.DS_Store +0 -0
  23. data/lib/cephalopod/repos/base.rb +54 -0
  24. data/lib/cephalopod/repos/v1/electricity_meter_points/consumption/collection.rb +16 -0
  25. data/lib/cephalopod/repos/v1/electricity_meter_points/resource.rb +14 -0
  26. data/lib/cephalopod/repos/v1/gas_meter_points/consumption/collection.rb +16 -0
  27. data/lib/cephalopod/repos/v1/gas_meter_points/resource.rb +14 -0
  28. data/lib/cephalopod/repos/v1/gsp/resource.rb +14 -0
  29. data/lib/cephalopod/repos/v1/products/collection.rb +18 -0
  30. data/lib/cephalopod/repos/v1/products/resource.rb +14 -0
  31. data/lib/cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection.rb +18 -0
  32. data/lib/cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection.rb +18 -0
  33. data/lib/cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection.rb +18 -0
  34. data/lib/cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection.rb +18 -0
  35. data/lib/cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection.rb +18 -0
  36. data/lib/cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection.rb +18 -0
  37. data/lib/cephalopod/response.rb +60 -0
  38. data/lib/cephalopod/types.rb +5 -0
  39. data/lib/cephalopod/version.rb +5 -0
  40. data/lib/cephalopod.rb +78 -0
  41. data/sig/cephalopod.rbs +4 -0
  42. metadata +211 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 98ac31fcdd412aa3e5edafa15f8fdb9ee358a5a94cb349ef35244963055a8dce
4
+ data.tar.gz: 8b5c07a13ce4859d21f6880c5e6fb071c5dbcebaf52aa375b77014bf65bdf939
5
+ SHA512:
6
+ metadata.gz: 0a213a54401eb5db0013c362be65b665b9471187f998e1ba031b4527ad40074d245c71b6768d85cfeed3c0936eb896a9bd2ed01ac02412d82a7a9cb4c8c7f428
7
+ data.tar.gz: 81c16f9b4dbc809cfca347b835899eab43e9dc93a3023b76b26d9a43f1d00b5462d409d3e21b6ae9a97fa8e5aceb042c23d107b5ceec2a3d2902d0c31fad4e8b
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
data/CHANGELOG.md ADDED
@@ -0,0 +1,5 @@
1
+ ## [Unreleased]
2
+
3
+ ## [0.1.0] - 2022-05-23
4
+
5
+ - Initial release
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at hello@adamcarlile.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in cephalopod.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
data/Gemfile.lock ADDED
@@ -0,0 +1,102 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ cephalopod (0.1.0)
5
+ activesupport
6
+ dry-struct
7
+ dry-validation
8
+ faraday
9
+ mustermann
10
+
11
+ GEM
12
+ remote: https://rubygems.org/
13
+ specs:
14
+ activesupport (7.0.3)
15
+ concurrent-ruby (~> 1.0, >= 1.0.2)
16
+ i18n (>= 1.6, < 2)
17
+ minitest (>= 5.1)
18
+ tzinfo (~> 2.0)
19
+ coderay (1.1.3)
20
+ concurrent-ruby (1.1.10)
21
+ diff-lcs (1.5.0)
22
+ dry-configurable (0.15.0)
23
+ concurrent-ruby (~> 1.0)
24
+ dry-core (~> 0.6)
25
+ dry-container (0.9.0)
26
+ concurrent-ruby (~> 1.0)
27
+ dry-configurable (~> 0.13, >= 0.13.0)
28
+ dry-core (0.7.1)
29
+ concurrent-ruby (~> 1.0)
30
+ dry-inflector (0.2.1)
31
+ dry-initializer (3.1.1)
32
+ dry-logic (1.2.0)
33
+ concurrent-ruby (~> 1.0)
34
+ dry-core (~> 0.5, >= 0.5)
35
+ dry-schema (1.9.1)
36
+ concurrent-ruby (~> 1.0)
37
+ dry-configurable (~> 0.13, >= 0.13.0)
38
+ dry-core (~> 0.5, >= 0.5)
39
+ dry-initializer (~> 3.0)
40
+ dry-logic (~> 1.0)
41
+ dry-types (~> 1.5)
42
+ dry-struct (1.4.0)
43
+ dry-core (~> 0.5, >= 0.5)
44
+ dry-types (~> 1.5)
45
+ ice_nine (~> 0.11)
46
+ dry-types (1.5.1)
47
+ concurrent-ruby (~> 1.0)
48
+ dry-container (~> 0.3)
49
+ dry-core (~> 0.5, >= 0.5)
50
+ dry-inflector (~> 0.1, >= 0.1.2)
51
+ dry-logic (~> 1.0, >= 1.0.2)
52
+ dry-validation (1.8.0)
53
+ concurrent-ruby (~> 1.0)
54
+ dry-container (~> 0.7, >= 0.7.1)
55
+ dry-core (~> 0.5, >= 0.5)
56
+ dry-initializer (~> 3.0)
57
+ dry-schema (~> 1.9, >= 1.9.1)
58
+ faraday (2.3.0)
59
+ faraday-net_http (~> 2.0)
60
+ ruby2_keywords (>= 0.0.4)
61
+ faraday-net_http (2.0.3)
62
+ i18n (1.10.0)
63
+ concurrent-ruby (~> 1.0)
64
+ ice_nine (0.11.2)
65
+ method_source (1.0.0)
66
+ minitest (5.15.0)
67
+ mustermann (1.1.1)
68
+ ruby2_keywords (~> 0.0.1)
69
+ pry (0.14.1)
70
+ coderay (~> 1.1)
71
+ method_source (~> 1.0)
72
+ rake (13.0.6)
73
+ rspec (3.11.0)
74
+ rspec-core (~> 3.11.0)
75
+ rspec-expectations (~> 3.11.0)
76
+ rspec-mocks (~> 3.11.0)
77
+ rspec-core (3.11.0)
78
+ rspec-support (~> 3.11.0)
79
+ rspec-expectations (3.11.0)
80
+ diff-lcs (>= 1.2.0, < 2.0)
81
+ rspec-support (~> 3.11.0)
82
+ rspec-mocks (3.11.1)
83
+ diff-lcs (>= 1.2.0, < 2.0)
84
+ rspec-support (~> 3.11.0)
85
+ rspec-support (3.11.0)
86
+ ruby2_keywords (0.0.5)
87
+ tzinfo (2.0.4)
88
+ concurrent-ruby (~> 1.0)
89
+
90
+ PLATFORMS
91
+ arm64-darwin-21
92
+ x86_64-darwin-20
93
+
94
+ DEPENDENCIES
95
+ bundler
96
+ cephalopod!
97
+ pry
98
+ rake (~> 13.0)
99
+ rspec (~> 3.0)
100
+
101
+ BUNDLED WITH
102
+ 2.3.14
data/LICENSE.txt ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022 Adam Carlile
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # Cephalopod
2
+
3
+ Cephalopod is an Octopus, and also a gem designed to query the Octopus Energy REST API.
4
+
5
+ ## Installation
6
+
7
+ Install the gem and add to the application's Gemfile by executing:
8
+
9
+ $ bundle add cephalopod
10
+
11
+ If bundler is not being used to manage dependencies, install the gem by executing:
12
+
13
+ $ gem install cephalopod
14
+
15
+ ## Usage
16
+
17
+ ### Configuration
18
+
19
+ ```ruby
20
+ Cephalopod.configure do |config|
21
+ config[:api_key] = "Your API key"
22
+ config[:base_url] = "https://api.octopus.energy"
23
+ end
24
+ ```
25
+
26
+ You will need an Octopus API key, this can be generated from your customer dashboard: https://octopus.energy/dashboard/developer/
27
+
28
+ ### Runtime
29
+
30
+ Products and tariffs can be retrieved
31
+ ```ruby
32
+ products = Cephalopod.products(query: {is_variable: true, available_at: DateTime.now})
33
+ # Available query params:
34
+ # is_variable (boolean, optional)
35
+ # is_green (boolean, optional)
36
+ # is_tracker (boolean, optional)
37
+ # is_prepay (boolean, optional)
38
+ # is_business (boolean, default: false)
39
+ # available_at (datetime, default: now)
40
+
41
+ detailed_product = products.first.details
42
+ ```
43
+ However to make sense of the tariffs that are available to you, you will need to determine your GSP (Grid Supply Point), which is a key like `_J`. These GSP's are based on your geographic location, as provided by a postcode lookup
44
+ ```ruby
45
+ gsp = Cephalopod.grid_supply_point(postcode: "W1D 1NN")
46
+ ```
47
+
48
+ You can also grab consumption data, if supported on your account
49
+ ```ruby
50
+ electrical_consumption = Cephalopod.electrical_consumption(mpan: "MPAN", serial_number: "METER SERIAL", query: {})
51
+ gas_consumption = Cephalopod.gas_consumption(mpan: "MPAN", serial_number: "METER SERIAL", query: {})
52
+ # Available query params
53
+ # period_from (datetime, optional)
54
+ # period_to (datetime, optional)
55
+ # page_size (int, optional)
56
+ # order_by (string, optional)
57
+ # group_by (string, optional)
58
+ ```
59
+ ## Development
60
+
61
+ After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
62
+
63
+ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
64
+
65
+ ## Contributing
66
+
67
+ Bug reports and pull requests are welcome on GitHub at https://github.com/adamcarlile/cephalopod. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/adamcarlile/cephalopod/blob/master/CODE_OF_CONDUCT.md).
68
+
69
+ ## License
70
+
71
+ The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
72
+
73
+ ## Code of Conduct
74
+
75
+ Everyone interacting in the Cephalopod project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/adamcarlile/cephalopod/blob/master/CODE_OF_CONDUCT.md).
data/Rakefile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ task default: :spec
@@ -0,0 +1,43 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "lib/cephalopod/version"
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "cephalopod"
7
+ spec.version = Cephalopod::VERSION
8
+ spec.authors = ["Adam Carlile"]
9
+ spec.email = ["hello@adamcarlile.com"]
10
+
11
+ spec.summary = "Gem to connect to the Octopus Energy API"
12
+ spec.homepage = "https://github.com/adamcarlile/cephalopod"
13
+ spec.license = "MIT"
14
+ spec.required_ruby_version = ">= 2.6.0"
15
+
16
+ spec.metadata["homepage_uri"] = spec.homepage
17
+ spec.metadata["source_code_uri"] = "https://github.com/adamcarlile/cephalopod"
18
+
19
+ # Specify which files should be added to the gem when it is released.
20
+ # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
21
+ spec.files = Dir.chdir(__dir__) do
22
+ `git ls-files -z`.split("\x0").reject do |f|
23
+ (f == __FILE__) || f.match(%r{\A(?:(?:bin|test|spec|features)/|\.(?:git|travis|circleci)|appveyor)})
24
+ end
25
+ end
26
+ spec.bindir = "exe"
27
+ spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
28
+ spec.require_paths = ["lib"]
29
+
30
+ spec.add_dependency "dry-struct"
31
+ spec.add_dependency "dry-validation"
32
+ spec.add_dependency "faraday"
33
+ spec.add_dependency "activesupport"
34
+ spec.add_dependency "mustermann"
35
+
36
+ spec.add_development_dependency "bundler"
37
+ spec.add_development_dependency "rake"
38
+ spec.add_development_dependency "rspec"
39
+ spec.add_development_dependency "pry"
40
+
41
+ # For more information and examples about making a new gem, check out our
42
+ # guide at: https://bundler.io/guides/creating_gem.html
43
+ end
@@ -0,0 +1,27 @@
1
+ module Cephalopod
2
+ class Adaptor
3
+
4
+ attr_reader :config
5
+ def initialize(**config)
6
+ @config = config
7
+ end
8
+
9
+ delegate :get, :post, :put, :patch, :delete, :run_request, to: :connection
10
+
11
+ private
12
+
13
+ def connection
14
+ @connection ||= Faraday.new(url: config[:base_url]) do |f|
15
+ f.headers['User-Agent'] = config.fetch(:user_agent, "Cephalopod Ruby Client v#{Cephalopod::VERSION}")
16
+ f.request :authorization, :basic, config[:api_key], ""
17
+ f.request :json
18
+
19
+ f.response :json, parser_options: { symbolize_names: true }
20
+ f.response :raise_error
21
+
22
+ f.adapter :net_http
23
+ end
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,7 @@
1
+ module Cephalopod
2
+ module Models
3
+ class Base < Dry::Struct
4
+ transform_keys(&:to_sym)
5
+ end
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ module Cephalopod
2
+ module Models
3
+ class Charge < Base
4
+
5
+ attribute :value_exc_vat, Types::Strict::Float
6
+ attribute :value_inc_vat, Types::Strict::Float
7
+ attribute :valid_from, Types::JSON::DateTime
8
+ attribute :valid_to, Types::JSON::DateTime
9
+
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ module Cephalopod
2
+ module Models
3
+ class Consumption < Base
4
+
5
+ attribute :consumption, Types::Strict::Float
6
+ attribute :interval_start, Types::JSON::DateTime
7
+ attribute :interval_end, Types::JSON::DateTime
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ module Cephalopod
2
+ module Models
3
+ class GSP < Base
4
+
5
+ attribute :group_id, Types::Strict::String
6
+
7
+ end
8
+ end
9
+ end
10
+
@@ -0,0 +1,15 @@
1
+ module Cephalopod
2
+ module Models
3
+ class Link < Base
4
+
5
+ attribute :href, Types::Strict::String
6
+ attribute :method, Types::Strict::String
7
+ attribute :rel, Types::Strict::String
8
+
9
+ def self?
10
+ rel == 'self'
11
+ end
12
+
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,11 @@
1
+ module Cephalopod
2
+ module Models
3
+ class MeterPoint < Base
4
+
5
+ attribute :gsp, Types::Strict::String
6
+ attribute :mpan, Types::Strict::String
7
+ attribute :profile_class, Types::Strict::Integer
8
+
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,35 @@
1
+ module Cephalopod
2
+ module Models
3
+ class Product < Base
4
+
5
+ attribute :code, Types::Strict::String
6
+ attribute :full_name, Types::Strict::String
7
+ attribute :display_name, Types::Strict::String
8
+ attribute :description, Types::Strict::String
9
+ attribute :is_variable, Types::Strict::Bool
10
+ attribute :is_green, Types::Strict::Bool
11
+ attribute :is_tracker, Types::Strict::Bool
12
+ attribute :is_prepay, Types::Strict::Bool
13
+ attribute :is_business, Types::Strict::Bool
14
+ attribute :is_restricted, Types::Strict::Bool
15
+ attribute :term, Types::Integer.optional
16
+ attribute :brand, Types::Strict::String
17
+ attribute :available_from, Types::Params::DateTime
18
+ attribute :available_to, Types::Params::DateTime.optional
19
+ attribute :tariffs_active_at, Types::Params::DateTime.optional
20
+ attribute :single_register_electricity_tariffs, Types::Params::Hash.map(Types::Strict::Symbol, Types::Params::Hash.map(Types::Strict::Symbol, Cephalopod::Models::Products::SingleRegisterCharge)).optional
21
+ attribute :dual_register_electricity_tariffs, Types::Params::Hash.map(Types::Strict::Symbol, Types::Params::Hash.map(Types::Strict::Symbol, Cephalopod::Models::Products::DualRegisterCharge)).optional
22
+ attribute :single_register_gas_tariffs, Types::Params::Hash.map(Types::Strict::Symbol, Types::Params::Hash.map(Types::Strict::Symbol, Cephalopod::Models::Products::SingleRegisterCharge)).optional
23
+
24
+ attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link)
25
+
26
+ alias_method :variable?, :is_variable
27
+ alias_method :green?, :is_green
28
+ alias_method :tracker?, :is_tracker
29
+ alias_method :prepay?, :is_prepay
30
+ alias_method :business?, :is_business
31
+ alias_method :is_restricted?, :is_restricted
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,35 @@
1
+ module Cephalopod
2
+ module Models
3
+ class ProductSummary < Base
4
+
5
+ attribute :code, Types::Strict::String
6
+ attribute :direction, Types::Strict::String
7
+ attribute :full_name, Types::Strict::String
8
+ attribute :display_name, Types::Strict::String
9
+ attribute :description, Types::Strict::String
10
+ attribute :is_variable, Types::Strict::Bool
11
+ attribute :is_green, Types::Strict::Bool
12
+ attribute :is_tracker, Types::Strict::Bool
13
+ attribute :is_prepay, Types::Strict::Bool
14
+ attribute :is_business, Types::Strict::Bool
15
+ attribute :is_restricted, Types::Strict::Bool
16
+ attribute :term, Types::Integer.optional
17
+ attribute :brand, Types::Strict::String
18
+ attribute :available_from, Types::Params::DateTime
19
+ attribute :available_to, Types::Params::DateTime.optional
20
+ attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link)
21
+
22
+ def details
23
+ @details ||= Cephalopod::Repos::V1::Products::Resource.new.get(code: code)
24
+ end
25
+
26
+ alias_method :variable?, :is_variable
27
+ alias_method :green?, :is_green
28
+ alias_method :tracker?, :is_tracker
29
+ alias_method :prepay?, :is_prepay
30
+ alias_method :business?, :is_business
31
+ alias_method :is_restricted?, :is_restricted
32
+
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,26 @@
1
+ module Cephalopod
2
+ module Models
3
+ module Products
4
+ class DualRegisterCharge < Base
5
+
6
+ attribute :code, Types::Strict::String
7
+ attribute :standing_charge_exc_vat, Types::Coercible::Float
8
+ attribute :standing_charge_inc_vat, Types::Coercible::Float
9
+ attribute :online_discount_exc_vat, Types::Coercible::Float
10
+ attribute :online_discount_inc_vat, Types::Coercible::Float
11
+ attribute :dual_fuel_discount_exc_vat, Types::Coercible::Float
12
+ attribute :dual_fuel_discount_inc_vat, Types::Coercible::Float
13
+ attribute :exit_fees_exc_vat, Types::Coercible::Float
14
+ attribute :exit_fees_inc_vat, Types::Coercible::Float
15
+ attribute :exit_fees_type, Types::Strict::String
16
+ attribute :day_unit_rate_exc_vat, Types::Coercible::Float
17
+ attribute :day_unit_rate_inc_vat, Types::Coercible::Float
18
+ attribute :night_unit_rate_exc_vat, Types::Coercible::Float
19
+ attribute :night_unit_rate_inc_vat, Types::Coercible::Float
20
+
21
+ attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link)
22
+
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,24 @@
1
+ module Cephalopod
2
+ module Models
3
+ module Products
4
+ class SingleRegisterCharge < Base
5
+
6
+ attribute :code, Types::Strict::String
7
+ attribute :standing_charge_exc_vat, Types::Coercible::Float
8
+ attribute :standing_charge_inc_vat, Types::Coercible::Float
9
+ attribute :online_discount_exc_vat, Types::Coercible::Float
10
+ attribute :online_discount_inc_vat, Types::Coercible::Float
11
+ attribute :dual_fuel_discount_exc_vat, Types::Coercible::Float
12
+ attribute :dual_fuel_discount_inc_vat, Types::Coercible::Float
13
+ attribute :exit_fees_exc_vat, Types::Coercible::Float
14
+ attribute :exit_fees_inc_vat, Types::Coercible::Float
15
+ attribute :exit_fees_type, Types::Strict::String
16
+ attribute :standard_unit_rate_exc_vat, Types::Coercible::Float
17
+ attribute :standard_unit_rate_inc_vat, Types::Coercible::Float
18
+
19
+ attribute :links, Types::Strict::Array.of(Cephalopod::Models::Link)
20
+
21
+ end
22
+ end
23
+ end
24
+ end
Binary file
@@ -0,0 +1,54 @@
1
+ module Cephalopod
2
+ module Repos
3
+ class Base
4
+ class << self
5
+ attr_accessor :default_model, :default_resource_route
6
+
7
+ def model(model)
8
+ self.default_model = model
9
+ end
10
+
11
+ def resource_route(path)
12
+ self.default_resource_route = path
13
+ end
14
+
15
+ def unsupported(*methods)
16
+ self.class_eval do
17
+ methods.each { |method| alias_method method, :undefined }
18
+ end
19
+ end
20
+
21
+ def route
22
+ @route ||= Mustermann.new(default_resource_route)
23
+ end
24
+ end
25
+
26
+ delegate :default_model, :default_resource_route, :route, to: :class
27
+
28
+ attr_reader :resource_route, :model
29
+
30
+ def initialize(client: Cephalopod.client,
31
+ model: default_model,
32
+ resource_route: default_resource_route)
33
+ @client, @model, @resource_route = client, model, resource_route
34
+ end
35
+
36
+ def get(method: :get, headers: {}, query: {}, body: nil, **params, &block)
37
+ @get ||= parse_response(@client.run_request(method, build_path(query: query, **params), body, headers, &block))
38
+ end
39
+
40
+ private
41
+
42
+ def parse_response(response, &block)
43
+ Cephalopod::Response.new(response: response, repo: self, &block)
44
+ end
45
+
46
+ def build_path(query: {}, **params)
47
+ URI.parse(route.expand(params)).tap do |uri|
48
+ uri.query = query.to_query unless query.blank?
49
+ end.to_s
50
+ end
51
+
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,16 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module ElectricityMeterPoints
5
+ module Consumption
6
+ class Collection < Base
7
+
8
+ model Cephalopod::Models::Consumption
9
+ resource_route '/v1/electricity-meter-points/:mpan/meters/:serial_number/consumption/'
10
+
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module ElectricityMeterPoints
5
+ class Resource < Base
6
+
7
+ model Cephalopod::Models::MeterPoint
8
+ resource_route '/v1/electricity-meter-points/:mpan/'
9
+
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,16 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module GasMeterPoints
5
+ module Consumption
6
+ class Collection < Base
7
+
8
+ model Cephalopod::Models::Consumption
9
+ resource_route '/v1/gas-meter-points/:mpan/meters/:serial_number/consumption/'
10
+
11
+ end
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,14 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module GasMeterPoints
5
+ class Resource < Base
6
+
7
+ model Cephalopod::Models::MeterPoint
8
+ resource_route '/v1/gas-meter-points/:mpan/'
9
+
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module GSP
5
+ class Resource < Base
6
+
7
+ model Cephalopod::Models::GSP
8
+ resource_route '/v1/industry/grid-supply-points/'
9
+
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Products
5
+ class Collection < Base
6
+
7
+ model Cephalopod::Models::ProductSummary
8
+ resource_route '/v1/products/'
9
+
10
+ def variable
11
+ select(:variable?)
12
+ end
13
+
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,14 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Products
5
+ class Resource < Base
6
+
7
+ model Cephalopod::Models::Product
8
+ resource_route '/v1/products/:code/'
9
+
10
+ end
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Tariffs
5
+ module Electricity
6
+ module DayUnitRates
7
+ class Collection < Base
8
+
9
+ model Cephalopod::Models::Charge
10
+ resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/day-unit-rates/'
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Tariffs
5
+ module Electricity
6
+ module NightUnitRates
7
+ class Collection < Base
8
+
9
+ model Cephalopod::Models::Charge
10
+ resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/night-unit-rates/'
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Tariffs
5
+ module Electricity
6
+ module StandardUnitRates
7
+ class Collection < Base
8
+
9
+ model Cephalopod::Models::Charge
10
+ resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/standard-unit-rates/'
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Tariffs
5
+ module Electricity
6
+ module StandingCharges
7
+ class Collection < Base
8
+
9
+ model Cephalopod::Models::Charge
10
+ resource_route '/v1/products/:product_code/electricity-tariffs/:tariff_code/standing-charges/'
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Tariffs
5
+ module Gas
6
+ module StandardUnitRates
7
+ class Collection < Base
8
+
9
+ model Cephalopod::Models::Charge
10
+ resource_route '/v1/products/:product_code/gas-tariffs/:tariff_code/standard-unit-rates/'
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ module Cephalopod
2
+ module Repos
3
+ module V1
4
+ module Tariffs
5
+ module Gas
6
+ module StandingCharges
7
+ class Collection < Base
8
+
9
+ model Cephalopod::Models::Charge
10
+ resource_route '/v1/products/:product_code/gas-tariffs/:tariff_code/standing-charges/'
11
+
12
+ end
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,60 @@
1
+ module Cephalopod
2
+ class Response < SimpleDelegator
3
+ module Pagination
4
+ def next_page
5
+ @repo.get(query: query.merge({ page: @response.body[:page].succ }))
6
+ end
7
+
8
+ def previous_page
9
+ @repo.get(query: query.merge({page: @response.body[:page].pred }))
10
+ end
11
+
12
+ def get_page(number)
13
+ @repo.get(query: query.merge({page: number}))
14
+ end
15
+
16
+ def payload
17
+ @response.body[:results]
18
+ end
19
+
20
+ def model_parser
21
+ payload.map {|x| @repo.model.new(x) }
22
+ end
23
+
24
+ end
25
+
26
+ def initialize(response:, repo:, &block)
27
+ @response = response
28
+ @repo = repo
29
+ extend Pagination if paginated?
30
+ super(block_given? ? yield(@response.body) : parse_response)
31
+ end
32
+
33
+ def paginated?
34
+ @response.body.is_a?(Hash) && pagination_links? && @response.body.key?(:results)
35
+ end
36
+
37
+ def pagination_links?
38
+ @response.body.key?(:next) || @response.body.key?(:previous)
39
+ end
40
+
41
+ def query
42
+ @query ||= URI::decode_www_form(@response.env.url.query).to_h.symbolize_keys
43
+ end
44
+
45
+ def payload
46
+ @response.body
47
+ end
48
+
49
+ protected
50
+
51
+ def parse_response
52
+ @repo.model ? model_parser : payload
53
+ end
54
+
55
+ def model_parser
56
+ @repo.model.new(payload)
57
+ end
58
+
59
+ end
60
+ end
@@ -0,0 +1,5 @@
1
+ module Cephalopod
2
+ module Types
3
+ include Dry.Types()
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cephalopod
4
+ VERSION = "0.2.0"
5
+ end
data/lib/cephalopod.rb ADDED
@@ -0,0 +1,78 @@
1
+ require 'active_support/all'
2
+ require 'dry-types'
3
+ require 'dry-struct'
4
+ require 'faraday'
5
+ require "mustermann"
6
+
7
+ require "cephalopod/version"
8
+
9
+ require "cephalopod/types"
10
+ require "cephalopod/adaptor"
11
+ require "cephalopod/response"
12
+
13
+ require "cephalopod/models/base"
14
+ require "cephalopod/models/link"
15
+ require "cephalopod/models/charge"
16
+ require "cephalopod/models/products/dual_register_charge"
17
+ require "cephalopod/models/products/single_register_charge"
18
+ require "cephalopod/models/product_summary"
19
+ require "cephalopod/models/product"
20
+ require "cephalopod/models/meter_point"
21
+ require "cephalopod/models/consumption"
22
+ require "cephalopod/models/gsp"
23
+
24
+ require "cephalopod/repos/base"
25
+ require "cephalopod/repos/v1/products/collection"
26
+ require "cephalopod/repos/v1/products/resource"
27
+
28
+ require "cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection"
29
+ require "cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection"
30
+ require "cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection"
31
+ require "cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection"
32
+ require "cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection"
33
+ require "cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection"
34
+
35
+ require "cephalopod/repos/v1/electricity_meter_points/resource"
36
+ require "cephalopod/repos/v1/electricity_meter_points/consumption/collection"
37
+ require "cephalopod/repos/v1/gas_meter_points/resource"
38
+ require "cephalopod/repos/v1/gas_meter_points/consumption/collection"
39
+
40
+ require "cephalopod/repos/v1/gsp/resource"
41
+
42
+
43
+ module Cephalopod
44
+ class Error < StandardError; end
45
+ extend self
46
+
47
+ def configure(&block)
48
+ yield(config)
49
+ end
50
+
51
+ def config
52
+ @config ||= {
53
+ base_url: 'https://api.octopus.energy',
54
+ api_key: 'api_key'
55
+ }
56
+ end
57
+
58
+ def client
59
+ @client ||= Cephalopod::Adaptor.new(**config)
60
+ end
61
+
62
+ def products(*args)
63
+ Cephalopod::Repos::V1::Products::Collection.new.get(*args)
64
+ end
65
+
66
+ def electrical_consumption(mpan:, serial_number:, **args)
67
+ Cephalopod::Repos::V1::ElectricityMeterPoints::Consumption::Collection.new.get(mpan: mpan, serial_number: serial_number, **args)
68
+ end
69
+
70
+ def gas_consumption(mpan:, serial_number:, **args)
71
+ Cephalopod::Repos::V1::GasMeterPoints::Consumption::Collection.new.get(mpan: mpan, serial_number: serial_number, **args)
72
+ end
73
+
74
+ def grid_supply_point(postcode:)
75
+ Cephalopod::Repos::V1::GSP::Resource.new.get(query: {postcode: postcode})
76
+ end
77
+
78
+ end
@@ -0,0 +1,4 @@
1
+ module Cephalopod
2
+ VERSION: String
3
+ # See the writing guide of rbs: https://github.com/ruby/rbs#guides
4
+ end
metadata ADDED
@@ -0,0 +1,211 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: cephalopod
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.2.0
5
+ platform: ruby
6
+ authors:
7
+ - Adam Carlile
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2023-02-07 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dry-struct
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: dry-validation
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: faraday
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: activesupport
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: mustermann
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: bundler
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: '0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rake
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: pry
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ description:
140
+ email:
141
+ - hello@adamcarlile.com
142
+ executables: []
143
+ extensions: []
144
+ extra_rdoc_files: []
145
+ files:
146
+ - ".rspec"
147
+ - CHANGELOG.md
148
+ - CODE_OF_CONDUCT.md
149
+ - Gemfile
150
+ - Gemfile.lock
151
+ - LICENSE.txt
152
+ - README.md
153
+ - Rakefile
154
+ - cephalopod.gemspec
155
+ - lib/cephalopod.rb
156
+ - lib/cephalopod/adaptor.rb
157
+ - lib/cephalopod/models/base.rb
158
+ - lib/cephalopod/models/charge.rb
159
+ - lib/cephalopod/models/consumption.rb
160
+ - lib/cephalopod/models/gsp.rb
161
+ - lib/cephalopod/models/link.rb
162
+ - lib/cephalopod/models/meter_point.rb
163
+ - lib/cephalopod/models/product.rb
164
+ - lib/cephalopod/models/product_summary.rb
165
+ - lib/cephalopod/models/products/dual_register_charge.rb
166
+ - lib/cephalopod/models/products/single_register_charge.rb
167
+ - lib/cephalopod/repos/.DS_Store
168
+ - lib/cephalopod/repos/base.rb
169
+ - lib/cephalopod/repos/v1/electricity_meter_points/consumption/collection.rb
170
+ - lib/cephalopod/repos/v1/electricity_meter_points/resource.rb
171
+ - lib/cephalopod/repos/v1/gas_meter_points/consumption/collection.rb
172
+ - lib/cephalopod/repos/v1/gas_meter_points/resource.rb
173
+ - lib/cephalopod/repos/v1/gsp/resource.rb
174
+ - lib/cephalopod/repos/v1/products/collection.rb
175
+ - lib/cephalopod/repos/v1/products/resource.rb
176
+ - lib/cephalopod/repos/v1/products/tariffs/electricity/day_unit_rates/collection.rb
177
+ - lib/cephalopod/repos/v1/products/tariffs/electricity/night_unit_rates/collection.rb
178
+ - lib/cephalopod/repos/v1/products/tariffs/electricity/standard_unit_rates/collection.rb
179
+ - lib/cephalopod/repos/v1/products/tariffs/electricity/standing_charges/collection.rb
180
+ - lib/cephalopod/repos/v1/products/tariffs/gas/standard_unit_rates/collection.rb
181
+ - lib/cephalopod/repos/v1/products/tariffs/gas/standing_charges/collection.rb
182
+ - lib/cephalopod/response.rb
183
+ - lib/cephalopod/types.rb
184
+ - lib/cephalopod/version.rb
185
+ - sig/cephalopod.rbs
186
+ homepage: https://github.com/adamcarlile/cephalopod
187
+ licenses:
188
+ - MIT
189
+ metadata:
190
+ homepage_uri: https://github.com/adamcarlile/cephalopod
191
+ source_code_uri: https://github.com/adamcarlile/cephalopod
192
+ post_install_message:
193
+ rdoc_options: []
194
+ require_paths:
195
+ - lib
196
+ required_ruby_version: !ruby/object:Gem::Requirement
197
+ requirements:
198
+ - - ">="
199
+ - !ruby/object:Gem::Version
200
+ version: 2.6.0
201
+ required_rubygems_version: !ruby/object:Gem::Requirement
202
+ requirements:
203
+ - - ">="
204
+ - !ruby/object:Gem::Version
205
+ version: '0'
206
+ requirements: []
207
+ rubygems_version: 3.3.7
208
+ signing_key:
209
+ specification_version: 4
210
+ summary: Gem to connect to the Octopus Energy API
211
+ test_files: []