Sha256: 46ae38fc8e6073324f700796fa8574b0016edd54c98c071e326de0df6f2d242a

Contents?: true

Size: 619 Bytes

Versions: 16

Compression:

Stored size: 619 Bytes

Contents

class ForestLiana::Collection
  mattr_accessor :collection_name

  def self.fields(fields)
    collection = ForestLiana::Model::Collection.new({
      name: self.collection_name,
      fields: fields
    })

    ForestLiana.apimap << collection
  end

  def self.action(name, opts = {})
    collection = ForestLiana.apimap.find do |x|
      x.name == self.collection_name.try(:to_s)
    end

    return if collection.blank?

    collection.actions << ForestLiana::Model::Action.new({
      name: name,
      http_method: opts[:http_method],
      endpoint: opts[:endpoint],
      fields: opts[:fields]
    })
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
forest_liana-1.2.3 app/services/forest_liana/collection.rb
forest_liana-1.2.2 app/services/forest_liana/collection.rb
forest_liana-1.2.1 app/services/forest_liana/collection.rb
forest_liana-1.1.35 app/services/forest_liana/collection.rb
forest_liana-1.1.34 app/services/forest_liana/collection.rb
forest_liana-1.1.33 app/services/forest_liana/collection.rb
forest_liana-1.1.32 app/services/forest_liana/collection.rb
forest_liana-1.1.31 app/services/forest_liana/collection.rb
forest_liana-1.1.30 app/services/forest_liana/collection.rb
forest_liana-1.1.29 app/services/forest_liana/collection.rb
forest_liana-1.1.28 app/services/forest_liana/collection.rb
forest_liana-1.1.27 app/services/forest_liana/collection.rb
forest_liana-1.1.26 app/services/forest_liana/collection.rb
forest_liana-1.1.25 app/services/forest_liana/collection.rb
forest_liana-1.1.23 app/services/forest_liana/collection.rb
forest_liana-1.1.22 app/services/forest_liana/collection.rb