Class: Releases::Links::Params

Inherits:
Object
  • Object
show all
Defined in:
app/services/releases/links/params.rb

Instance Method Summary collapse

Constructor Details

#initialize(params) ⇒ Params

Returns a new instance of Params.



6
7
8
# File 'app/services/releases/links/params.rb', line 6

def initialize(params)
  @params = params.with_indifferent_access
end

Instance Method Details

#allowed_paramsObject



10
11
12
13
14
# File 'app/services/releases/links/params.rb', line 10

def allowed_params
  @allowed_params ||= params.slice(:name, :url, :link_type).tap do |hash|
    hash[:filepath] = filepath if provided_filepath?
  end
end