Class: Cindy::Environment
- Inherits:
-
Object
- Object
- Cindy::Environment
- Defined in:
- lib/cindy/environment.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(name, uri) ⇒ Environment
constructor
A new instance of Environment.
- #to_s ⇒ Object
- #update(attributes) ⇒ Object
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
4 5 6 |
# File 'lib/cindy/environment.rb', line 4 def name @name end |
#uri ⇒ Object (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_s ⇒ Object
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 |