Sha256: 50b5e52250902a16890d6a5dfc5128c1e53f4fd434c235dd9934cd714941106f

Contents?: true

Size: 524 Bytes

Versions: 11

Compression:

Stored size: 524 Bytes

Contents

module Mousetrap
  class Plan < Resource
    attr_accessor \
      :code,
      :name

    def self.all
      response = get_resources plural_resource_name
      return [] unless response['plans']
      build_resources_from response
    end

    protected

    def self.plural_resource_name
      'plans'
    end

    def self.singular_resource_name
      'plan'
    end

    def self.attributes_from_api(attributes)
      {
        :code => attributes['code'],
        :name => attributes['name']
      }
    end
  end
end

Version data entries

11 entries across 11 versions & 4 rubygems

Version Path
oel-brenner-mousetrap-0.5.2 lib/mousetrap/plan.rb
ambethia-mousetrap-0.5.1 lib/mousetrap/plan.rb
cameroncox-mousetrap-0.5.2 lib/mousetrap/plan.rb
cameroncox-mousetrap-0.5.1 lib/mousetrap/plan.rb
mousetrap-0.5.0 lib/mousetrap/plan.rb
mousetrap-0.4.4 lib/mousetrap/plan.rb
mousetrap-0.4.3 lib/mousetrap/plan.rb
mousetrap-0.4.2 lib/mousetrap/plan.rb
mousetrap-0.4.1 lib/mousetrap/plan.rb
mousetrap-0.4.0 lib/mousetrap/plan.rb
mousetrap-0.3.3 lib/mousetrap/plan.rb