Class: Cindy::Environment

Inherits:
Object
  • Object
show all
Defined in:
lib/cindy/environment.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, uri) ⇒ Environment

Returns a new instance of Environment.



6
7
8
9
# File 'lib/cindy/environment.rb', line 6

def initialize(name, uri)
    @uri = uri
    @name = name
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



4
5
6
# File 'lib/cindy/environment.rb', line 4

def name
  @name
end

#uriObject (readonly)

Returns the value of attribute uri.



4
5
6
# File 'lib/cindy/environment.rb', line 4

def uri
  @uri
end

Instance Method Details

#to_sObject



11
12
13
# File 'lib/cindy/environment.rb', line 11

def to_s
    "environment :#{@name}, #{@uri.inspect}"
end

#update(attributes) ⇒ Object



15
16
17
18
# File 'lib/cindy/environment.rb', line 15

def update(attributes)
    @uri = attributes['uri'] if attributes['uri']
    @name = attributes['name'] if attributes['name']
end