Class: WCC::Blogs::Property

Inherits:
Object
  • Object
show all
Extended by:
Utils
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

Constructor Details

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

Returns a new instance of Property.



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

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

Instance Attribute Details

#rawObject (readonly)

Returns the value of attribute raw.



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

def raw
  @raw
end

Class Method Details

.find(property = nil) ⇒ Object



8
9
10
# File 'lib/wcc/blogs/property.rb', line 8

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

Instance Method Details



31
32
33
# File 'lib/wcc/blogs/property.rb', line 31

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

#to_paramObject



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

def to_param
  key
end