Sha256: 289c3374c92b789720b8e914f696e55a270ab555fa079e091b7ac248ac2400cf

Contents?: true

Size: 1.37 KB

Versions: 5

Compression:

Stored size: 1.37 KB

Contents

# This file is part of KalibroClient
# Copyright (C) 2013  it's respectives authors (please see the AUTHORS file)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

module KalibroClient
  module Entities
    module Processor
      class KalibroModule < KalibroClient::Entities::Processor::Base
        attr_accessor :granularity, :id, :long_name, :module_result_id

        def initialize(attributes = {}, persisted = false)
          super
          @granularity = KalibroClient::Entities::Miscellaneous::Granularity.new attributes['granularity']['type']
        end

        def name=(value)
          @long_name = (value.is_a?(Array) ? value.join('.') : value)
        end

        def name
          @long_name.split('.')
        end

        def short_name
          name.last
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
kalibro_client-5.0.0 lib/kalibro_client/entities/processor/kalibro_module.rb
kalibro_client-4.0.0 lib/kalibro_client/entities/processor/kalibro_module.rb
kalibro_client-4.0.0.alpha1 lib/kalibro_client/entities/processor/kalibro_module.rb
kalibro_client-3.0.1 lib/kalibro_client/entities/processor/kalibro_module.rb
kalibro_client-3.0.0 lib/kalibro_client/entities/processor/kalibro_module.rb