Class: Daylight::API::HashResourcePassthrough

Inherits:
Object
  • Object
show all
Defined in:
lib/daylight/api.rb

Overview

Used to assist ‘find_or_create_resource_for` to use embedded attributes to new Daylight::API model objects.

See: find_or_create_resource_for

Class Method Summary collapse

Class Method Details

.new(value, _) ⇒ Object



227
228
229
230
# File 'lib/daylight/api.rb', line 227

def self.new(value, _)
  # load values using ActiveResource::Base and extract them as attributes
  Daylight::API.new(value.duplicable? ? value.dup : value).attributes
end