Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support #to_h and #to_hash on the Hyperclient::Resource #104

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jufemaiz
Copy link

@jufemaiz jufemaiz commented Aug 18, 2016

[:_attributes, :_embedded, :_links].each do |target|
target = send(target)
puts target.inspect
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stray puts

@dblock
Copy link
Collaborator

dblock commented Aug 18, 2016

Fix tests, add to CHANGELOG, squash commits please.

@dblock
Copy link
Collaborator

dblock commented Aug 18, 2016

We might need to drop some old(er) rubies to get a build going and possibly lock some gems. Let us know if you can't do it part of this PR, I can take a look at some point.

@jufemaiz
Copy link
Author

@dblock not sure why - this was a straight branch from master here.

ruby-1.9.3p551 https://travis-ci.org/codegram/hyperclient/jobs/153170104

Installing ruby_dep 1.4.0
Gem::InstallError: ruby_dep requires Ruby version >= 2.2.5, ~> 2.2.
Using hashdiff 0.3.0
Using uri_template 0.7.0
Using metaclass 0.0.4
Using powerpack 0.1.1
Installing json 2.0.2 with native extensions
Gem::InstallError: json requires Ruby version ~> 2.0.

Features are failing, not sure why (again, this was a straight branch from here):
https://travis-ci.org/codegram/hyperclient/jobs/153170108

@dblock
Copy link
Collaborator

dblock commented Aug 19, 2016

As I said, we're bringing newer dependencies in (gems don't check in a Gemfile.lock), and some things no longer work.

@dblock
Copy link
Collaborator

dblock commented Aug 20, 2016

I've fixed the build in #105, you can rebase.

@dangerpr-bot
Copy link

dangerpr-bot commented Aug 22, 2016

1 Error
🚫 One of the lines below found in CHANGELOG.md doesn’t match the expected format. Please make it look like the other lines, pay attention to version numbers, periods, spaces and date formats.
This version is no longer tested with Ruby < 2.2.
* [#104](https://github.com/codegram/hyperclient/pull/104): fix #to_h and #to_hash on Hyperclient::Resource - [@jufemaiz](https://github.com/jufemaiz)
### 0.9.0 (January 10, 2018)
### 0.8.6 (August 27, 2017)
### 0.8.5 (July 5, 2017)
### 0.8.4 (May 16, 2017)
### 0.8.3 (March 30, 2017)
### 0.8.2 (December 31, 2016)
#### This version is no longer tested with Ruby < 2.2.
### 0.8.1 (March 15, 2016)
### 0.7.2 (August 23, 2015)
### 0.7.1 (August 15, 2015)
### 0.7.0 (February 23, 2015)
#### This version introduces several backwards incompatible changes. See [UPGRADING](UPGRADING.md) for details.
### 0.6.1 (October 17, 2014)
### 0.5.0 (October 1, 2014)
### 0.4.0 (May 5, 2014)
### 0.3.2 (December 20, 2013)
### 0.3.1 (April 3, 2013)
### 0.3.0 (February 3, 2013)

Generated by 🚫 Danger

@dblock
Copy link
Collaborator

dblock commented Aug 22, 2016

Danger and build still not happy. See above.

@jufemaiz
Copy link
Author

@dblock the problem is the delegation to the children directly as per https://github.com/codegram/hyperclient/blob/master/features/steps/api_navigation.rb#L45-L46 + https://github.com/codegram/hyperclient/blob/master/features/steps/api_navigation.rb#L51

I can't find the approach used to go from the Hyperclient::Resource directly to the embedded elements "posts". It's got something to do with the outcome of the method_missing (https://github.com/codegram/hyperclient/blob/master/lib/hyperclient/resource.rb#L84-L94) function returning nil.

@dblock
Copy link
Collaborator

dblock commented Sep 27, 2016

Can't you just implement to_h and to_hash explicitly? Or skip these in method_missing?

@dblock
Copy link
Collaborator

dblock commented Aug 30, 2017

Bump @jufemaiz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants