Class: Application

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serializers::JSON, ActiveModel::Serializers::Xml
Defined in:
lib/generators/resty/setup/templates/application.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Application

Returns a new instance of Application.



7
8
9
10
# File 'lib/generators/resty/setup/templates/application.rb', line 7

def initialize(attributes = {})
  @name = attributes['name']
  @url = attributes['url']
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/generators/resty/setup/templates/application.rb', line 5

def name
  @name
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/generators/resty/setup/templates/application.rb', line 5

def url
  @url
end

Instance Method Details

#attributesObject



12
13
14
# File 'lib/generators/resty/setup/templates/application.rb', line 12

def attributes
  { 'name' => name, 'url' => url }
end