Class: Alpinist::Descriptor

Inherits:
Object
  • Object
show all
Defined in:
lib/alpinist/descriptor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id: nil, name: nil, type: nil, rt: nil, href: nil, doc: nil, ext: nil, reference: nil) ⇒ Descriptor

Returns a new instance of Descriptor.



6
7
8
9
10
11
12
13
14
15
# File 'lib/alpinist/descriptor.rb', line 6

def initialize(id: nil, name: nil, type: nil, rt: nil, href: nil, doc: nil, ext: nil, reference: nil)
  @id = id
  @name = name
  @type = type
  @rt = rt
  @href = href
  @doc = doc
  @ext = ext
  @reference = reference
end

Instance Attribute Details

#docObject (readonly)

Returns the value of attribute doc.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def doc
  @doc
end

#extObject (readonly)

Returns the value of attribute ext.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def ext
  @ext
end

#hrefObject (readonly)

Returns the value of attribute href.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def href
  @href
end

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def id
  @id
end

#nameObject (readonly)

Returns the value of attribute name.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def name
  @name
end

#referenceObject

Returns the value of attribute reference.



4
5
6
# File 'lib/alpinist/descriptor.rb', line 4

def reference
  @reference
end

#rtObject (readonly)

Returns the value of attribute rt.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def rt
  @rt
end

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/alpinist/descriptor.rb', line 3

def type
  @type
end

Instance Method Details

#inspectObject



17
18
19
20
21
# File 'lib/alpinist/descriptor.rb', line 17

def inspect
  display_variable_name = %w(@id @name @type @rt @href @doc @ext)
  variables_inspect = display_variable_name.map{ |n| "#{n}=#{instance_variable_get(n).inspect}" }.join(' ')
  "#<#{self.class}:#{__id__} #{variables_inspect}>"
end