Class: Enterprisifier::Marshalling::Namespace

Inherits:
Object
  • Object
show all
Defined in:
lib/enterprisifier/marshalling/namespace.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(short_name, url) ⇒ Namespace

Returns a new instance of Namespace.



6
7
8
# File 'lib/enterprisifier/marshalling/namespace.rb', line 6

def initialize(short_name, url)
  @short_name, @url = short_name, url
end

Instance Attribute Details

#short_nameObject (readonly)

Returns the value of attribute short_name.



4
5
6
# File 'lib/enterprisifier/marshalling/namespace.rb', line 4

def short_name
  @short_name
end

#urlObject (readonly)

Returns the value of attribute url.



4
5
6
# File 'lib/enterprisifier/marshalling/namespace.rb', line 4

def url
  @url
end

Instance Method Details

#==(other_ns) ⇒ Object



10
11
12
# File 'lib/enterprisifier/marshalling/namespace.rb', line 10

def ==(other_ns)
  other_ns.url == url
end

#hashObject



14
15
16
# File 'lib/enterprisifier/marshalling/namespace.rb', line 14

def hash
  url.hash
end

#is?(short_name_or_url) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/enterprisifier/marshalling/namespace.rb', line 18

def is?(short_name_or_url)
  @short_name == short_name_or_url || @url == short_name_or_url
end