lib/her/model/orm.rb
# Build a new resource with the given attributes.
# If the request_new_object_on_build flag is set, the new object is requested via API.
Build a new resource with the given attributes.
If the request_new_object_on_build flag is set, the new object is requested via API.
Build a new resource with the given attributes . If the request_new_object_on_build flag is set the new object is requested via API .
def build(attributes = {})
          params = attributes
          return new(params) unless request_new_object_on_build?
          path = build_request_path(params.merge(primary_key => 'new'))
          method = method_for(:new)
          resource = nil
          request(params.merge(:_method => method, :_path => path)) do |parsed_data, response|
            if response.success?
              resource = new_from_parsed_data(parsed_data)
            end
          end
          resource
        end
def build ( attributes = { } ) params = attributes return new ( params ) unless request_new_object_on_build? path = build_request_path ( params . merge ( primary_key => 'new' ) ) method = method_for ( :new ) resource = nil request ( params . merge ( :_method => method , :_path => path ) ) do | parsed_data , response | if response . success? resource = new_from_parsed_data ( parsed_data ) end end resource end
Build a new resource with the given attributes.
Build a new resource with the given attributes .
attributes
<not_specific>