Class: WCC::Blogs::Property

Inherits:
Object
  • Object
show all
Extended by:
Utils
Includes:
Concerns::Caching
Defined in:
lib/wcc/blogs/property.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Utils

camelcase, define_camelcase_alias

Methods included from Concerns::Caching

#cache_key, #cache_key_with_version, #cache_version

Constructor Details

#initialize(raw, client: WCC::Blogs.client) ⇒ Property

Returns a new instance of Property.



17
18
19
20
# File 'lib/wcc/blogs/property.rb', line 17

def initialize(raw, client: WCC::Blogs.client)
  @raw = raw
  @client = client
end

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



15
16
17
# File 'lib/wcc/blogs/property.rb', line 15

def raw
  @raw
end

Class Method Details

.find(property = nil, client: WCC::Blogs.client) ⇒ Object



11
12
13
# File 'lib/wcc/blogs/property.rb', line 11

def self.find(property = nil, client: WCC::Blogs.client)
  new(client.property_show(property).raw, client: client)
end

Instance Method Details



34
35
36
# File 'lib/wcc/blogs/property.rb', line 34

def _links
  OpenStruct.new(raw['_links'] || {})
end

#to_paramObject



22
23
24
# File 'lib/wcc/blogs/property.rb', line 22

def to_param
  key
end