Class: Icss::Meta::Source

Inherits:
Object show all
Includes:
ReceiverModel, ReceiverModel::ActsAsCatalog
Defined in:
lib/icss/protocol/source.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from ReceiverModel::ActsAsCatalog

included, #register

Methods included from ReceiverModel

included, #tree_merge!

Methods included from ReceiverModel::ActsAsTuple

included, #to_tuple

Methods included from RecordModel

#attr_set?, included, #receive!, #to_zaml

Methods included from ReceiverModel::ActsAsLoadable

#merge_from_file!

Methods included from ReceiverModel::ActsAsHash

#[], #[]=, #attributes, #delete, included, #keys

Class Method Details

.catalog_sectionsObject



21
22
23
# File 'lib/icss/protocol/source.rb', line 21

def self.catalog_sections
  ['sources']
end

Instance Method Details

#fullnameObject



12
13
14
# File 'lib/icss/protocol/source.rb', line 12

def fullname
  source_id
end

#nameObject Also known as: basename



16
17
18
# File 'lib/icss/protocol/source.rb', line 16

def name
  source_id.split('.').last
end

#to_hashObject



25
26
27
28
29
30
# File 'lib/icss/protocol/source.rb', line 25

def to_hash()
  { :source_id => source_id,
    :title => title,
    :description => description,
    :url => url }
end

#to_jsonObject



32
# File 'lib/icss/protocol/source.rb', line 32

def to_json() to_hash.to_json ; end