Class: EasyCaddy::Site

Inherits:
Data
  • Object
show all
Defined in:
lib/easy_caddy/site.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#enabledObject (readonly)

Returns the value of attribute enabled

Returns:

  • (Object)

    the current value of enabled



4
5
6
# File 'lib/easy_caddy/site.rb', line 4

def enabled
  @enabled
end

#nameObject (readonly)

Returns the value of attribute name

Returns:

  • (Object)

    the current value of name



4
5
6
# File 'lib/easy_caddy/site.rb', line 4

def name
  @name
end

#source_pathObject (readonly)

Returns the value of attribute source_path

Returns:

  • (Object)

    the current value of source_path



4
5
6
# File 'lib/easy_caddy/site.rb', line 4

def source_path
  @source_path
end

Class Method Details

.from_h(h) ⇒ Object



5
6
7
# File 'lib/easy_caddy/site.rb', line 5

def self.from_h(h)
  new(name: h['name'], enabled: h.fetch('enabled', true), source_path: h['source_path'])
end

Instance Method Details

#to_hObject



9
10
11
# File 'lib/easy_caddy/site.rb', line 9

def to_h
  { 'name' => name, 'enabled' => enabled, 'source_path' => source_path }
end