. It is not ef ciently in a case that response data size is enormous, especially Bigquery. Re nements enable to replace serialization implementation in speci c context. (It is already unnecessary now)
instance end def from_json(body, options) @instance.merge!(Oj.load(body)) end end module HashrizeGetJobQueryResults refine Google::Apis::BigqueryV2::BigqueryService do def get_job_query_results(*args) command = make_simple_command(:get, 'projects/{projectId command.response_representation = SimpleHashRepresentable command.response_class = Hash # Omit end end end end
to uentd. That data consists of various objects. I want to implement some helper methods in those classes. Re nements can implement helper methods that is called in concern module context only.
end def fluentd_payload # constructing payload end def fluentd_timestamp created_at end # Other helpers end end) def post_to_fluentd # Publish to external context Fluent::Logger.post_with_time( fluentd_tag, fluentd_payload, fluentd_timestamp) end end
alternative of binding_of_caller class Foo extend BindingNinja def foo(binding, arg) p binding p arg end auto_inject_binding :foo end Foo.new.foo(1) # => <Binding of toplevel> # => 1
| 2 | 3 5 | 8 | 13 0 | 0 | 0 end with_them do it "should do additions" do expect(a + b).to eq answer end end end RSpec ExampleGroup is actual Class de nition. It is Re nements friendly